Best Python code snippet using tempest_python
test_floating_ips_port_forwarding_client.py
Source:test_floating_ips_port_forwarding_client.py
...52 floating_ips_port_forwarding_client.\53 FloatingIpsPortForwardingClient(fake_auth,54 "network",55 "regionOne")56 def _test_create_port_forwarding(self, bytes_body=False):57 self.check_service_client_function(58 self.floating_ips_port_forwarding_client.59 create_port_forwarding,60 "tempest.lib.common.rest_client.RestClient.post",61 self.FAKE_PORT_FORWARDING_RESPONSE,62 bytes_body,63 201,64 floatingip_id=self.FAKE_FLOATINGIP_ID,65 **self.FAKE_PORT_FORWARDING_REQUEST)66 def _test_list_port_forwardings(self, bytes_body=False):67 self.check_service_client_function(68 self.floating_ips_port_forwarding_client.69 list_port_forwardings,70 "tempest.lib.common.rest_client.RestClient.get",71 self.FAKE_PORT_FORWARDINGS,72 bytes_body,73 200,74 floatingip_id=self.FAKE_FLOATINGIP_ID)75 def _test_show_port_forwardings(self, bytes_body=False):76 self.check_service_client_function(77 self.floating_ips_port_forwarding_client.78 show_port_forwarding,79 "tempest.lib.common.rest_client.RestClient.get",80 self.FAKE_PORT_FORWARDING_RESPONSE,81 bytes_body,82 200,83 floatingip_id=self.FAKE_FLOATINGIP_ID,84 port_forwarding_id=self.FAKE_PORT_FORWARDING_ID)85 def _test_delete_port_forwarding(self):86 self.check_service_client_function(87 self.floating_ips_port_forwarding_client.88 delete_port_forwarding,89 "tempest.lib.common.rest_client.RestClient.delete",90 {},91 status=204,92 floatingip_id=self.FAKE_FLOATINGIP_ID,93 port_forwarding_id=self.FAKE_PORT_FORWARDING_ID)94 def _test_update_port_forwarding(self, bytes_body=False):95 update_kwargs = {96 "internal_port": "27"97 }98 resp_body = {99 "port_forwarding": copy.deepcopy(100 self.FAKE_PORT_FORWARDING_RESPONSE['port_forwarding']101 )102 }103 resp_body["port_forwarding"].update(update_kwargs)104 self.check_service_client_function(105 self.floating_ips_port_forwarding_client.update_port_forwarding,106 "tempest.lib.common.rest_client.RestClient.put",107 resp_body,108 bytes_body,109 200,110 floatingip_id=self.FAKE_FLOATINGIP_ID,111 port_forwarding_id=self.FAKE_PORT_FORWARDING_ID,112 **update_kwargs)113 def test_list_port_forwardings_with_str_body(self):114 self._test_list_port_forwardings()115 def test_list_port_forwardings_with_bytes_body(self):116 self._test_list_port_forwardings(bytes_body=True)117 def test_show_port_forwardings_with_str_body(self):118 self._test_show_port_forwardings()119 def test_show_port_forwardings_with_bytes_body(self):120 self._test_show_port_forwardings(bytes_body=True)121 def test_create_port_forwarding_with_str_body(self):122 self._test_create_port_forwarding()123 def test_create_port_forwarding_with_bytes_body(self):124 self._test_create_port_forwarding(bytes_body=True)125 def test_update_port_forwarding_with_str_body(self):126 self._test_update_port_forwarding()127 def test_update_port_forwarding_with_bytes_body(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!!