"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/contrib/federation/test_utils.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

test_utils.py  (keystone-16.0.1):test_utils.py  (keystone-17.0.0)
skipping to change at line 802 skipping to change at line 802
"name": "Staging", "name": "Staging",
"roles": [{"name": "member"}] "roles": [{"name": "member"}]
}, },
{ {
"name": "Project for %s" % expected_username, "name": "Project for %s" % expected_username,
"roles": [{"name": "admin"}] "roles": [{"name": "admin"}]
} }
] ]
self.assertEqual(expected_projects, values['projects']) self.assertEqual(expected_projects, values['projects'])
def test_rule_engine_for_groups_and_domain(self):
"""Should return user's groups and group domain.
The GROUP_DOMAIN_ASSERTION should successfully have a match in
MAPPING_GROUPS_DOMAIN_OF_USER. This will test the case where a groups
with its domain will exist`, and return user's groups and group domain.
"""
mapping = mapping_fixtures.MAPPING_GROUPS_DOMAIN_OF_USER
assertion = mapping_fixtures.GROUPS_DOMAIN_ASSERTION
rp = mapping_utils.RuleProcessor(FAKE_MAPPING_ID, mapping['rules'])
values = rp.process(assertion)
self.assertValidMappedUserObject(values)
user_name = assertion.get('openstack_user')
user_groups = ['group1', 'group2'] # since we know the input assertion
groups = values.get('group_names', {})
group_list = [g.get('name') for g in groups]
group_ids = values.get('group_ids')
name = values.get('user', {}).get('name')
self.assertEqual(user_name, name)
self.assertEqual(user_groups, group_list)
self.assertEqual([], group_ids, )
class TestUnicodeAssertionData(unit.BaseTestCase): class TestUnicodeAssertionData(unit.BaseTestCase):
"""Ensure that unicode data in the assertion headers works. """Ensure that unicode data in the assertion headers works.
Bug #1525250 reported that something was not getting correctly encoded Bug #1525250 reported that something was not getting correctly encoded
and/or decoded when assertion data contained non-ASCII characters. and/or decoded when assertion data contained non-ASCII characters.
This test class mimics what happens in a real HTTP request. This test class mimics what happens in a real HTTP request.
""" """
def setUp(self): def setUp(self):
 End of changes. 1 change blocks. 
0 lines changed or deleted 25 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)