Best Python code snippet using tempest_python
test_trusts.py
Source:test_trusts.py  
...136        self.validate_role(roles_get[0])137        _, role_get = self.trustor_client.get_trust_role(138            self.trust_id, self.delegated_role_id)139        self.validate_role(role_get)140        _, role_get = self.trustor_client.check_trust_role(141            self.trust_id, self.delegated_role_id)142        # And that we don't find not_delegated_role143        self.assertRaises(exceptions.NotFound,144                          self.trustor_client.get_trust_role,145                          self.trust_id,146                          self.not_delegated_role_id)147        self.assertRaises(exceptions.NotFound,148                          self.trustor_client.check_trust_role,149                          self.trust_id,150                          self.not_delegated_role_id)151    def delete_trust(self):152        self.trustor_client.delete_trust(self.trust_id)153        self.assertRaises(exceptions.NotFound,154                          self.trustor_client.get_trust,...trusts_client.py
Source:trusts_client.py  
...61                              % (trust_id, role_id))62        self.expected_success(200, resp.status)63        body = json.loads(body)64        return rest_client.ResponseBody(resp, body)65    def check_trust_role(self, trust_id, role_id):66        """HEAD Check if role is delegated by a trust."""67        resp, body = self.head("OS-TRUST/trusts/%s/roles/%s"68                               % (trust_id, role_id))69        self.expected_success(200, resp.status)...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!!
