diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-02-16 18:22:58 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-02-16 18:22:58 +0000 |
commit | bdacbfb0ca9c44fa29f900df06bf3dd06bfc9e9b (patch) | |
tree | 6200885a314052d6bbe1b4b3423800d09c4b1260 | |
parent | 68ac0592def361c1c4d613557988d8e6ff7bc77d (diff) | |
parent | a322ceea9df5c4733e09bfe24510bf58e4f37d9e (diff) | |
download | keystone-bdacbfb0ca9c44fa29f900df06bf3dd06bfc9e9b.tar.gz |
Merge "Improve testing of unicode id mapping" into stable/juno
-rw-r--r-- | keystone/tests/test_backend_id_mapping_sql.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/keystone/tests/test_backend_id_mapping_sql.py b/keystone/tests/test_backend_id_mapping_sql.py index b8cdff141..bf319e242 100644 --- a/keystone/tests/test_backend_id_mapping_sql.py +++ b/keystone/tests/test_backend_id_mapping_sql.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may @@ -118,6 +119,21 @@ class SqlIDMapping(test_backend_sql.SqlTests): self.assertThat(mapping_sql.list_id_mappings(), matchers.HasLength(initial_mappings)) + def test_id_mapping_handles_unicode(self): + local_id = u'fäké1' + local_entity = {'domain_id': self.domainA['id'], + 'local_id': local_id, + 'entity_type': mapping.EntityType.USER} + + # Check no mappings for the new local entity + self.assertIsNone(self.id_mapping_api.get_public_id(local_entity)) + + # The mapping generator should handle unicode, although currently this + # fails due to bug #1419187 + self.assertRaises(UnicodeEncodeError, + self.id_mapping_api.create_id_mapping, + local_entity) + def test_delete_public_id_is_silent(self): # Test that deleting an invalid public key is silent self.id_mapping_api.delete_id_mapping(uuid.uuid4().hex) |