Best Python code snippet using tempest_python
test_roles_client.py
Source:test_roles_client.py
...65 self.client.list_roles,66 'tempest.lib.common.rest_client.RestClient.get',67 self.FAKE_LIST_ROLES,68 bytes_body)69 def _test_update_role(self, bytes_body=False):70 self.check_service_client_function(71 self.client.update_role,72 'tempest.lib.common.rest_client.RestClient.patch',73 self.FAKE_ROLE_INFO,74 bytes_body,75 role_id="1",76 name="test")77 def _test_create_user_role_on_project(self, bytes_body=False):78 self.check_service_client_function(79 self.client.create_user_role_on_project,80 'tempest.lib.common.rest_client.RestClient.put',81 {},82 bytes_body,83 project_id="b344506af7644f6794d9cb316600b020",84 user_id="123",85 role_id="1234",86 status=204)87 def _test_create_user_role_on_domain(self, bytes_body=False):88 self.check_service_client_function(89 self.client.create_user_role_on_domain,90 'tempest.lib.common.rest_client.RestClient.put',91 {},92 bytes_body,93 domain_id="b344506af7644f6794d9cb316600b020",94 user_id="123",95 role_id="1234",96 status=204)97 def _test_list_user_roles_on_project(self, bytes_body=False):98 self.check_service_client_function(99 self.client.list_user_roles_on_project,100 'tempest.lib.common.rest_client.RestClient.get',101 self.FAKE_LIST_ROLES,102 bytes_body,103 project_id="b344506af7644f6794d9cb316600b020",104 user_id="123")105 def _test_list_user_roles_on_domain(self, bytes_body=False):106 self.check_service_client_function(107 self.client.list_user_roles_on_domain,108 'tempest.lib.common.rest_client.RestClient.get',109 self.FAKE_LIST_ROLES,110 bytes_body,111 domain_id="b344506af7644f6794d9cb316600b020",112 user_id="123")113 def _test_create_group_role_on_project(self, bytes_body=False):114 self.check_service_client_function(115 self.client.create_group_role_on_project,116 'tempest.lib.common.rest_client.RestClient.put',117 {},118 bytes_body,119 project_id="b344506af7644f6794d9cb316600b020",120 group_id="123",121 role_id="1234",122 status=204)123 def _test_create_group_role_on_domain(self, bytes_body=False):124 self.check_service_client_function(125 self.client.create_group_role_on_domain,126 'tempest.lib.common.rest_client.RestClient.put',127 {},128 bytes_body,129 domain_id="b344506af7644f6794d9cb316600b020",130 group_id="123",131 role_id="1234",132 status=204)133 def _test_list_group_roles_on_project(self, bytes_body=False):134 self.check_service_client_function(135 self.client.list_group_roles_on_project,136 'tempest.lib.common.rest_client.RestClient.get',137 self.FAKE_LIST_ROLES,138 bytes_body,139 project_id="b344506af7644f6794d9cb316600b020",140 group_id="123")141 def _test_list_group_roles_on_domain(self, bytes_body=False):142 self.check_service_client_function(143 self.client.list_group_roles_on_domain,144 'tempest.lib.common.rest_client.RestClient.get',145 self.FAKE_LIST_ROLES,146 bytes_body,147 domain_id="b344506af7644f6794d9cb316600b020",148 group_id="123")149 def test_create_role_with_str_body(self):150 self._test_create_role()151 def test_create_role_with_bytes_body(self):152 self._test_create_role(bytes_body=True)153 def test_show_role_with_str_body(self):154 self._test_show_role()155 def test_show_role_with_bytes_body(self):156 self._test_show_role(bytes_body=True)157 def test_list_roles_with_str_body(self):158 self._test_list_roles()159 def test_list_roles_with_bytes_body(self):160 self._test_list_roles(bytes_body=True)161 def test_update_role_with_str_body(self):162 self._test_update_role()163 def test_update_role_with_bytes_body(self):164 self._test_update_role(bytes_body=True)165 def test_delete_role(self):166 self.check_service_client_function(167 self.client.delete_role,168 'tempest.lib.common.rest_client.RestClient.delete',169 {},170 role_id="1",171 status=204)172 def test_create_user_role_on_project_with_str_body(self):173 self._test_create_user_role_on_project()174 def test_create_user_role_on_project_with_bytes_body(self):175 self._test_create_user_role_on_project(bytes_body=True)176 def test_create_user_role_on_domain_with_str_body(self):177 self._test_create_user_role_on_domain()178 def test_create_user_role_on_domain_with_bytes_body(self):...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!