Best Python code snippet using tempest_python
test_server_metadata.py
Source:test_server_metadata.py
...76 meta = self.client.show_server_metadata_item(self.server_id,77 'key2')['meta']78 self.assertEqual('value2', meta['key2'])79 @test.idempotent_id('58c02d4f-5c67-40be-8744-d3fa5982eb1c')80 def test_set_server_metadata_item(self):81 # The item's value should be updated to the provided value82 # Update the metadata value83 meta = {'nova': 'alt'}84 self.client.set_server_metadata_item(self.server_id, 'nova', meta)85 # Verify the meta item's value has been updated86 resp_metadata = (self.client.list_server_metadata(self.server_id)87 ['metadata'])88 expected = {'key1': 'value1', 'key2': 'value2', 'nova': 'alt'}89 self.assertEqual(expected, resp_metadata)90 @test.idempotent_id('127642d6-4c7b-4486-b7cd-07265a378658')91 def test_delete_server_metadata_item(self):92 # The metadata value/key pair should be deleted from the server93 self.client.delete_server_metadata_item(self.server_id, 'key1')94 # Verify the metadata item has been removed...
test_server_metadata_rbac.py
Source:test_server_metadata_rbac.py
...61 @decorators.idempotent_id('79511293-4bd7-447d-ba7e-634d0f4da70c')62 @rbac_rule_validation.action(63 service="nova",64 rules=["os_compute_api:server-metadata:update"])65 def test_set_server_metadata_item(self):66 with self.override_role():67 self.servers_client.set_server_metadata_item(68 self.server['id'], 'default_key', {'default_key': 'value2'})69 @decorators.idempotent_id('feec5064-678d-40bc-a88f-c856e18d1e31')70 @rbac_rule_validation.action(71 service="nova",72 rules=["os_compute_api:server-metadata:delete"])73 def test_delete_server_metadata_item(self):74 with self.override_role():75 self.servers_client.delete_server_metadata_item(...
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!!