How to use delete_inherited_role_from_user_on_project method in tempest

Best Python code snippet using tempest_python

test_inherits.py

Source:test_inherits.py Github

copy

Full Screen

...103 (self.inherited_roles_client.104 check_user_has_flag_on_inherited_to_project(105 self.project['id'], self.user['id'], src_role['id']))106 # Revoke role from projects user107 self.inherited_roles_client.delete_inherited_role_from_user_on_project(108 self.project['id'], self.user['id'], src_role['id'])109 @decorators.idempotent_id('26021436-d5a4-4256-943c-ded01e0d4b45')110 def test_inherit_assign_check_revoke_roles_on_projects_group(self):111 # Create role112 src_role = self.setup_test_role()113 # Assign role on projects group114 self.inherited_roles_client.create_inherited_role_on_projects_group(115 self.project['id'], self.group['id'], src_role['id'])116 # Check role on projects group117 (self.inherited_roles_client.118 check_group_has_flag_on_inherited_to_project(119 self.project['id'], self.group['id'], src_role['id']))120 # Revoke role from projects group121 (self.inherited_roles_client.122 delete_inherited_role_from_group_on_project(123 self.project['id'], self.group['id'], src_role['id']))124 @decorators.idempotent_id('3acf666e-5354-42ac-8e17-8b68893bcd36')125 def test_inherit_assign_list_revoke_user_roles_on_domain(self):126 # Create role127 src_role = self.setup_test_role()128 # Create a project hierarchy129 leaf_project = self.setup_test_project(domain_id=self.domain['id'],130 parent_id=self.project['id'])131 # Assign role on domain132 self.inherited_roles_client.create_inherited_role_on_domains_user(133 self.domain['id'], self.user['id'], src_role['id'])134 # List "effective" role assignments from user on the parent project135 params = {'scope.project.id': self.project['id'],136 'user.id': self.user['id']}137 assignments = self.role_assignments.list_role_assignments(138 effective=True, **params)['role_assignments']139 self.assertNotEmpty(assignments)140 # List "effective" role assignments from user on the leaf project141 params['scope.project.id'] = leaf_project['id']142 assignments = self.role_assignments.list_role_assignments(143 effective=True, **params)['role_assignments']144 self.assertNotEmpty(assignments)145 # Revoke role from domain146 self.inherited_roles_client.delete_inherited_role_from_user_on_domain(147 self.domain['id'], self.user['id'], src_role['id'])148 # List "effective" role assignments from user on the parent project149 # should return an empty list150 params['scope.project.id'] = self.project['id']151 assignments = self.role_assignments.list_role_assignments(152 effective=True, **params)['role_assignments']153 self.assertEmpty(assignments)154 # List "effective" role assignments from user on the leaf project155 # should return an empty list156 params['scope.project.id'] = leaf_project['id']157 assignments = self.role_assignments.list_role_assignments(158 effective=True, **params)['role_assignments']159 self.assertEmpty(assignments)160 @decorators.idempotent_id('9f02ccd9-9b57-46b4-8f77-dd5a736f3a06')161 def test_inherit_assign_list_revoke_user_roles_on_project_tree(self):162 # Create role163 src_role = self.setup_test_role()164 # Create a project hierarchy165 leaf_project = self.setup_test_project(domain_id=self.domain['id'],166 parent_id=self.project['id'])167 # Assign role on parent project168 self.inherited_roles_client.create_inherited_role_on_projects_user(169 self.project['id'], self.user['id'], src_role['id'])170 # List "effective" role assignments from user on the leaf project171 params = {'scope.project.id': leaf_project['id'],172 'user.id': self.user['id']}173 assignments = self.role_assignments.list_role_assignments(174 effective=True, **params)['role_assignments']175 self.assertNotEmpty(assignments)176 # Revoke role from parent project177 self.inherited_roles_client.delete_inherited_role_from_user_on_project(178 self.project['id'], self.user['id'], src_role['id'])179 # List "effective" role assignments from user on the leaf project180 # should return an empty list181 assignments = self.role_assignments.list_role_assignments(182 effective=True, **params)['role_assignments']...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful