Best Python code snippet using tempest_python
test_server_metadata.py
Source:test_server_metadata.py
...29 super(ServerMetadataTestJSON, self).setUp()30 meta = {'key1': 'value1', 'key2': 'value2'}31 self.client.set_server_metadata(self.server_id, meta)['metadata']32 @test.idempotent_id('479da087-92b3-4dcf-aeb3-fd293b2d14ce')33 def test_list_server_metadata(self):34 # All metadata key/value pairs for a server should be returned35 resp_metadata = (self.client.list_server_metadata(self.server_id)36 ['metadata'])37 # Verify the expected metadata items are in the list38 expected = {'key1': 'value1', 'key2': 'value2'}39 self.assertEqual(expected, resp_metadata)40 @test.idempotent_id('211021f6-21de-4657-a68f-908878cfe251')41 def test_set_server_metadata(self):42 # The server's metadata should be replaced with the provided values43 # Create a new set of metadata for the server44 req_metadata = {'meta2': 'data2', 'meta3': 'data3'}45 self.client.set_server_metadata(self.server_id,46 req_metadata)['metadata']47 # Verify the expected values are correct, and that the...
test_server_metadata_rbac.py
Source:test_server_metadata_rbac.py
...32 @decorators.idempotent_id('b07bbc27-58e2-4581-869d-ad228cec5d9a')33 @rbac_rule_validation.action(34 service="nova",35 rules=["os_compute_api:server-metadata:index"])36 def test_list_server_metadata(self):37 with self.override_role():38 self.servers_client.list_server_metadata(self.server['id'])39 @decorators.idempotent_id('6e76748b-2417-4fa2-b41a-c0cc4bff356b')40 @rbac_rule_validation.action(41 service="nova",42 rules=["os_compute_api:server-metadata:update_all"])43 def test_set_server_metadata(self):44 with self.override_role():45 self.servers_client.set_server_metadata(self.server['id'], {})46 @decorators.idempotent_id('1060bac4-fe16-4a77-be64-d8e482a06eab')47 @rbac_rule_validation.action(48 service="nova",49 rules=["os_compute_api:server-metadata:create"])50 def test_update_server_metadata(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!!