Best Python code snippet using tempest_python
test_trusts.py
Source: test_trusts.py
...127 self.assertNotEqual(self.not_delegated_role_id, role['id'])128 self.assertNotEqual(self.not_delegated_role, role['name'])129 self.assertNotIn('v3/roles/%s' % self.not_delegated_role_id,130 role['links']['self'])131 def check_trust_roles(self):132 # Check we find the delegated role133 _, roles_get = self.trustor_client.get_trust_roles(134 self.trust_id)135 self.assertEqual(1, len(roles_get))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,155 self.trust_id)156 self.trust_id = None157class TrustsV3TestJSON(BaseTrustsV3Test):158 _interface = 'json'159 def setUp(self):160 super(TrustsV3TestJSON, self).setUp()161 self.create_trustor_and_roles()162 self.addCleanup(self.cleanup_user_and_roles)163 @test.attr(type='smoke')164 def test_trust_impersonate(self):165 # Test case to check we can create, get and delete a trust166 # updates are not supported for trusts167 trust = self.create_trust()168 self.validate_trust(trust)169 trust_get = self.get_trust()170 self.validate_trust(trust_get)171 self.check_trust_roles()172 @test.attr(type='smoke')173 def test_trust_noimpersonate(self):174 # Test case to check we can create, get and delete a trust175 # with impersonation=False176 trust = self.create_trust(impersonate=False)177 self.validate_trust(trust, impersonate=False)178 trust_get = self.get_trust()179 self.validate_trust(trust_get, impersonate=False)180 self.check_trust_roles()181 @test.attr(type='smoke')182 def test_trust_expire(self):183 # Test case to check we can create, get and delete a trust184 # with an expiry specified185 expires_at = timeutils.utcnow() + datetime.timedelta(hours=1)186 expires_str = timeutils.isotime(at=expires_at, subsecond=True)187 trust = self.create_trust(expires=expires_str)188 self.validate_trust(trust, expires=expires_str)189 trust_get = self.get_trust()190 self.validate_trust(trust_get, expires=expires_str)191 self.check_trust_roles()192 @test.attr(type='smoke')193 def test_trust_expire_invalid(self):194 # Test case to check we can check an invlaid expiry time195 # is rejected with the correct error196 # with an expiry specified197 expires_str = 'bad.123Z'198 self.assertRaises(exceptions.BadRequest,199 self.create_trust,200 expires=expires_str)201 @test.attr(type='smoke')202 def test_get_trusts_query(self):203 self.create_trust()204 _, trusts_get = self.trustor_client.get_trusts(205 trustor_user_id=self.trustor_user_id)...
Check out the latest blogs from LambdaTest on this topic:
These days, development teams depend heavily on feedback from automated tests to evaluate the quality of the system they are working on.
I think that probably most development teams describe themselves as being “agile” and probably most development teams have standups, and meetings called retrospectives.There is also a lot of discussion about “agile”, much written about “agile”, and there are many presentations about “agile”. A question that is often asked is what comes after “agile”? Many testers work in “agile” teams so this question matters to us.
I routinely come across test strategy documents when working with customers. They are lengthy—100 pages or more—and packed with monotonous text that is routinely reused from one project to another. Yawn once more— the test halt and resume circumstances, the defect management procedure, entrance and exit criteria, unnecessary generic risks, and in fact, one often-used model replicates the requirements of textbook testing, from stress to systems integration.
To understand the agile testing mindset, we first need to determine what makes a team “agile.” To me, an agile team continually focuses on becoming self-organized and cross-functional to be able to complete any challenge they may face during a project.
When working on web automation with Selenium, I encountered scenarios where I needed to refresh pages from time to time. When does this happen? One scenario is that I needed to refresh the page to check that the data I expected to see was still available even after refreshing. Another possibility is to clear form data without going through each input individually.
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!!