"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_v3_assignment.py" between
keystone-16.0.0.tar.gz and keystone-16.0.1.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 "Train" series (latest release).

test_v3_assignment.py  (keystone-16.0.0):test_v3_assignment.py  (keystone-16.0.1)
skipping to change at line 920 skipping to change at line 920
group1 = PROVIDERS.identity_api.create_group(group1) group1 = PROVIDERS.identity_api.create_group(group1)
PROVIDERS.identity_api.add_user_to_group(user1['id'], group1['id']) PROVIDERS.identity_api.add_user_to_group(user1['id'], group1['id'])
PROVIDERS.identity_api.add_user_to_group(user2['id'], group1['id']) PROVIDERS.identity_api.add_user_to_group(user2['id'], group1['id'])
project1 = unit.new_project_ref(domain_id=self.domain['id']) project1 = unit.new_project_ref(domain_id=self.domain['id'])
PROVIDERS.resource_api.create_project(project1['id'], project1) PROVIDERS.resource_api.create_project(project1['id'], project1)
self.role1 = unit.new_role_ref() self.role1 = unit.new_role_ref()
PROVIDERS.role_api.create_role(self.role1['id'], self.role1) PROVIDERS.role_api.create_role(self.role1['id'], self.role1)
self.role2 = unit.new_role_ref() self.role2 = unit.new_role_ref()
PROVIDERS.role_api.create_role(self.role2['id'], self.role2) PROVIDERS.role_api.create_role(self.role2['id'], self.role2)
# Now add one of each of the four types of assignment # Now add one of each of the six types of assignment
gd_entity = self.build_role_assignment_entity( gd_entity = self.build_role_assignment_entity(
domain_id=self.domain_id, group_id=group1['id'], domain_id=self.domain_id, group_id=group1['id'],
role_id=self.role1['id']) role_id=self.role1['id'])
self.put(gd_entity['links']['assignment']) self.put(gd_entity['links']['assignment'])
ud_entity = self.build_role_assignment_entity(domain_id=self.domain_id, ud_entity = self.build_role_assignment_entity(domain_id=self.domain_id,
user_id=user1['id'], user_id=user1['id'],
role_id=self.role2['id']) role_id=self.role2['id'])
self.put(ud_entity['links']['assignment']) self.put(ud_entity['links']['assignment'])
skipping to change at line 944 skipping to change at line 944
group_id=group1['id'], group_id=group1['id'],
role_id=self.role1['id']) role_id=self.role1['id'])
self.put(gp_entity['links']['assignment']) self.put(gp_entity['links']['assignment'])
up_entity = self.build_role_assignment_entity( up_entity = self.build_role_assignment_entity(
project_id=project1['id'], project_id=project1['id'],
user_id=user1['id'], user_id=user1['id'],
role_id=self.role2['id']) role_id=self.role2['id'])
self.put(up_entity['links']['assignment']) self.put(up_entity['links']['assignment'])
gs_entity = self.build_role_assignment_entity(
system='all',
group_id=group1['id'],
role_id=self.role1['id'])
self.put(gs_entity['links']['assignment'])
us_entity = self.build_role_assignment_entity(
system='all',
user_id=user1['id'],
role_id=self.role2['id'])
self.put(us_entity['links']['assignment'])
us2_entity = self.build_role_assignment_entity(
system='all',
user_id=user2['id'],
role_id=self.role2['id'])
self.put(us2_entity['links']['assignment'])
# Now list by various filters to make sure we get back the right ones # Now list by various filters to make sure we get back the right ones
collection_url = ('/role_assignments?scope.project.id=%s' % collection_url = ('/role_assignments?scope.project.id=%s' %
project1['id']) project1['id'])
r = self.get(collection_url, expected_status=http_client.OK) r = self.get(collection_url, expected_status=http_client.OK)
self.head(collection_url, expected_status=http_client.OK) self.head(collection_url, expected_status=http_client.OK)
self.assertValidRoleAssignmentListResponse(r, self.assertValidRoleAssignmentListResponse(r,
expected_length=2, expected_length=2,
resource_url=collection_url) resource_url=collection_url)
self.assertRoleAssignmentInListResponse(r, up_entity) self.assertRoleAssignmentInListResponse(r, up_entity)
skipping to change at line 970 skipping to change at line 986
self.assertValidRoleAssignmentListResponse(r, self.assertValidRoleAssignmentListResponse(r,
expected_length=2, expected_length=2,
resource_url=collection_url) resource_url=collection_url)
self.assertRoleAssignmentInListResponse(r, ud_entity) self.assertRoleAssignmentInListResponse(r, ud_entity)
self.assertRoleAssignmentInListResponse(r, gd_entity) self.assertRoleAssignmentInListResponse(r, gd_entity)
collection_url = '/role_assignments?user.id=%s' % user1['id'] collection_url = '/role_assignments?user.id=%s' % user1['id']
r = self.get(collection_url, expected_status=http_client.OK) r = self.get(collection_url, expected_status=http_client.OK)
self.head(collection_url, expected_status=http_client.OK) self.head(collection_url, expected_status=http_client.OK)
self.assertValidRoleAssignmentListResponse(r, self.assertValidRoleAssignmentListResponse(r,
expected_length=2, expected_length=3,
resource_url=collection_url) resource_url=collection_url)
self.assertRoleAssignmentInListResponse(r, up_entity) self.assertRoleAssignmentInListResponse(r, up_entity)
self.assertRoleAssignmentInListResponse(r, ud_entity) self.assertRoleAssignmentInListResponse(r, ud_entity)
collection_url = '/role_assignments?group.id=%s' % group1['id'] collection_url = '/role_assignments?group.id=%s' % group1['id']
r = self.get(collection_url, expected_status=http_client.OK) r = self.get(collection_url, expected_status=http_client.OK)
self.head(collection_url, expected_status=http_client.OK) self.head(collection_url, expected_status=http_client.OK)
self.assertValidRoleAssignmentListResponse(r, self.assertValidRoleAssignmentListResponse(r,
expected_length=2, expected_length=3,
resource_url=collection_url) resource_url=collection_url)
self.assertRoleAssignmentInListResponse(r, gd_entity) self.assertRoleAssignmentInListResponse(r, gd_entity)
self.assertRoleAssignmentInListResponse(r, gp_entity) self.assertRoleAssignmentInListResponse(r, gp_entity)
collection_url = '/role_assignments?role.id=%s' % self.role1['id'] collection_url = '/role_assignments?role.id=%s' % self.role1['id']
r = self.get(collection_url, expected_status=http_client.OK) r = self.get(collection_url, expected_status=http_client.OK)
self.head(collection_url, expected_status=http_client.OK) self.head(collection_url, expected_status=http_client.OK)
self.assertValidRoleAssignmentListResponse(r, self.assertValidRoleAssignmentListResponse(r,
expected_length=2, expected_length=3,
resource_url=collection_url) resource_url=collection_url)
self.assertRoleAssignmentInListResponse(r, gd_entity) self.assertRoleAssignmentInListResponse(r, gd_entity)
self.assertRoleAssignmentInListResponse(r, gp_entity) self.assertRoleAssignmentInListResponse(r, gp_entity)
self.assertRoleAssignmentInListResponse(r, gs_entity)
collection_url = '/role_assignments?role.id=%s' % self.role2['id']
r = self.get(collection_url, expected_status=http_client.OK)
self.head(collection_url, expected_status=http_client.OK)
self.assertValidRoleAssignmentListResponse(r,
expected_length=4,
resource_url=collection_url)
self.assertRoleAssignmentInListResponse(r, ud_entity)
self.assertRoleAssignmentInListResponse(r, up_entity)
self.assertRoleAssignmentInListResponse(r, us_entity)
# Let's try combining two filers together.... # Let's try combining two filers together....
collection_url = ( collection_url = (
'/role_assignments?user.id=%(user_id)s' '/role_assignments?user.id=%(user_id)s'
'&scope.project.id=%(project_id)s' % { '&scope.project.id=%(project_id)s' % {
'user_id': user1['id'], 'user_id': user1['id'],
'project_id': project1['id']}) 'project_id': project1['id']})
r = self.get(collection_url, expected_status=http_client.OK) r = self.get(collection_url, expected_status=http_client.OK)
self.head(collection_url, expected_status=http_client.OK) self.head(collection_url, expected_status=http_client.OK)
 End of changes. 6 change blocks. 
4 lines changed or deleted 31 lines changed or added

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