def _test_show_network(self, fmt): LOG.debug("_test_show_network - fmt:%s - START", fmt) content_type = "application/%s" % fmt network_id = self._create_network(fmt) show_network_req = testlib.show_network_request(self.tenant_id, network_id, fmt) show_network_res = show_network_req.get_response(self.api) self.assertEqual(show_network_res.status_int, 200) network_data = self._deserialize_net_response(content_type, show_network_res) self.assert_network(id=network_id, name=self.network_name, network_data=network_data["network"]) LOG.debug("_test_show_network - fmt:%s - END", fmt)
def _test_create_network(self, fmt): LOG.debug("_test_create_network - fmt:%s - START", fmt) content_type = "application/%s" % fmt network_id = self._create_network(fmt) show_network_req = testlib.show_network_request(self.tenant_id, network_id, fmt) show_network_res = show_network_req.get_response(self.api) self.assertEqual(show_network_res.status_int, 200) network_data = self._net_deserializers[content_type].deserialize(show_network_res.body)["body"] self.assertEqual(network_id, network_data["network"]["id"]) LOG.debug("_test_create_network - fmt:%s - END", fmt)
def _test_show_network_not_found(self, fmt): LOG.debug("_test_show_network_not_found - fmt:%s - START", fmt) show_network_req = testlib.show_network_request(self.tenant_id, "A_BAD_ID", fmt) show_network_res = show_network_req.get_response(self.api) self.assertEqual(show_network_res.status_int, self._network_not_found_code) LOG.debug("_test_show_network_not_found - fmt:%s - END", fmt)