Best Python code snippet using tempest_python
test_server_misc_policy_actions_rbac.py
Source:test_server_misc_policy_actions_rbac.py
...100 @decorators.idempotent_id('189bfed4-1e6d-475c-bb8c-d57e60895391')101 @rbac_rule_validation.action(102 service="nova",103 rule="os_compute_api:os-deferred-delete")104 def test_force_delete_server(self):105 """Test force delete server, part of os-deferred-delete."""106 self.rbac_utils.switch_role(self, toggle_rbac_role=True)107 # Force-deleting a server enforces os-deferred-delete.108 self.servers_client.force_delete_server(self.server_id)109 @rbac_rule_validation.action(110 service="nova",111 rule="os_compute_api:os-lock-server:lock")112 @decorators.idempotent_id('b81e10fb-1864-498f-8c1d-5175c6fec5fb')113 def test_lock_server(self):114 """Test lock server, part of os-lock-server."""115 self.rbac_utils.switch_role(self, toggle_rbac_role=True)116 self.servers_client.lock_server(self.server_id)117 self.addCleanup(self.servers_client.unlock_server, self.server_id)118 @rbac_rule_validation.action(...
servers_test.py
Source:servers_test.py
...72 }73 self.client.servers.delete_server(server_id=77)74 mock_api.assert_called_with(**expected)75 @mock.patch('pydactyl.api.base.PterodactylAPI._api_request')76 def test_force_delete_server(self, mock_api):77 expected = {78 'endpoint': 'application/servers/88/force',79 'mode': 'DELETE',80 }81 self.client.servers.delete_server(server_id=88, force=True)82 mock_api.assert_called_with(**expected)83 @mock.patch('pydactyl.api.base.PterodactylAPI._api_request')84 def test_list_server_databases(self, mock_api):85 expected = {86 'endpoint': 'application/servers/99/databases',87 }88 self.client.servers.list_server_databases(server_id=99)89 mock_api.assert_called_with(**expected)90 @mock.patch('pydactyl.api.base.PterodactylAPI._api_request')...
test_deferred_delete_rbac.py
Source:test_deferred_delete_rbac.py
...31 @decorators.idempotent_id('189bfed4-1e6d-475c-bb8c-d57e60895391')32 @rbac_rule_validation.action(33 service="nova",34 rule="os_compute_api:os-deferred-delete")35 def test_force_delete_server(self):36 self.rbac_utils.switch_role(self, toggle_rbac_role=True)37 # Force-deleting a server enforces os-deferred-delete according to the38 # following API: https://github.com/openstack/nova/blob/master/nova/api39 # /openstack/compute/deferred_delete.py...
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!!