Best Python code snippet using tempest_python
test_account_services.py
Source:test_account_services.py
...36 self.assertIsNotNone(container_list)37 container_names = [c['name'] for c in container_list]38 self.assertTrue(self.container_name in container_names)39 @attr(type='smoke')40 def test_list_account_metadata(self):41 # List all account metadata42 resp, metadata = self.account_client.list_account_metadata()43 self.assertEqual(resp['status'], '204')44 self.assertIn('x-account-object-count', resp)45 self.assertIn('x-account-container-count', resp)46 self.assertIn('x-account-bytes-used', resp)47 @attr(type='smoke')48 def test_create_account_metadata(self):49 # Add metadata to account50 metadata = {'test-account-meta': 'Meta!'}51 resp, _ = \52 self.account_client.create_account_metadata(metadata=metadata)53 self.assertEqual(resp['status'], '204')54 resp, metadata = self.account_client.list_account_metadata()55 self.assertIn('x-account-meta-test-account-meta', resp)56 self.assertEqual(resp['x-account-meta-test-account-meta'], 'Meta!')57 @attr(type='smoke')58 def test_delete_account_metadata(self):59 # Delete metadata from account60 metadata = ['test-account-meta']61 resp, _ = \62 self.account_client.delete_account_metadata(metadata=metadata)63 self.assertEqual(resp['status'], '204')64 resp, metadata = self.account_client.list_account_metadata()65 self.assertNotIn('x-account-meta-test-account-meta', resp)66 @attr(type='negative')67 def test_list_containers_with_non_authorized_user(self):68 #Listing containers with using non authorized user69 # Randomly creating user70 self.data.setup_test_user()71 resp, body = \72 self.token_client.auth(self.data.test_user,73 self.data.test_password,74 self.data.test_tenant)75 new_token = \76 self.token_client.get_token(self.data.test_user,77 self.data.test_password,78 self.data.test_tenant)...
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!!