Best Python code snippet using tempest_python
test_floating_ips_client.py
Source:test_floating_ips_client.py
...56 super(TestFloatingIPsClient, self).setUp()57 fake_auth = fake_auth_provider.FakeAuthProvider()58 self.floating_ips_client = floating_ips_client.FloatingIPsClient(59 fake_auth, "compute", "regionOne")60 def _test_list_floatingips(self, bytes_body=False):61 self.check_service_client_function(62 self.floating_ips_client.list_floatingips,63 "tempest.lib.common.rest_client.RestClient.get",64 self.FAKE_FLOATING_IPS,65 bytes_body,66 200)67 def _test_create_floatingip(self, bytes_body=False):68 self.check_service_client_function(69 self.floating_ips_client.create_floatingip,70 "tempest.lib.common.rest_client.RestClient.post",71 {"floatingip": self.FAKE_FLOATING_IPS["floatingips"][1]},72 bytes_body,73 201,74 floating_network_id="172.24.4.228")75 def _test_show_floatingip(self, bytes_body=False):76 self.check_service_client_function(77 self.floating_ips_client.show_floatingip,78 "tempest.lib.common.rest_client.RestClient.get",79 {"floatingip": self.FAKE_FLOATING_IPS["floatingips"][0]},80 bytes_body,81 200,82 floatingip_id=self.FAKE_FLOATING_IP_ID)83 def _test_update_floatingip(self, bytes_body=False):84 update_kwargs = {85 "port_id": "fc861431-0e6c-4842-a0ed-e2363f9bc3a8"86 }87 resp_body = {88 "floatingip": copy.deepcopy(89 self.FAKE_FLOATING_IPS["floatingips"][0]90 )91 }92 resp_body["floatingip"].update(update_kwargs)93 self.check_service_client_function(94 self.floating_ips_client.update_floatingip,95 "tempest.lib.common.rest_client.RestClient.put",96 resp_body,97 bytes_body,98 200,99 floatingip_id=self.FAKE_FLOATING_IP_ID,100 **update_kwargs)101 def test_list_floatingips_with_str_body(self):102 self._test_list_floatingips()103 def test_list_floatingips_with_bytes_body(self):104 self._test_list_floatingips(bytes_body=True)105 def test_create_floatingip_with_str_body(self):106 self._test_create_floatingip()107 def test_create_floatingip_with_bytes_body(self):108 self._test_create_floatingip(bytes_body=True)109 def test_show_floatingips_with_str_body(self):110 self._test_show_floatingip()111 def test_show_floatingips_with_bytes_body(self):112 self._test_show_floatingip(bytes_body=True)113 def test_update_floatingip_with_str_body(self):114 self._test_update_floatingip()115 def test_update_floatingip_with_bytes_body(self):116 self._test_update_floatingip(bytes_body=True)117 def test_delete_floatingip(self):118 self.check_service_client_function(...
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!!