From: Cedric Brandily Date: Wed, 29 Jul 2015 11:15:49 +0000 (+0000) Subject: Python 3: compare response.body to bytes in namespace_proxy test X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=7809f1574ce7c2adad070c5d00b17d818ae3cae5;p=openstack-build%2Fneutron-build.git Python 3: compare response.body to bytes in namespace_proxy test WebOb response bodies should be compared to bytes not string. Change-Id: I2c17d39cc394a1d583b4f4971c0db9ba1875a0d0 Blueprint: neutron-python3 --- diff --git a/neutron/tests/unit/agent/metadata/test_namespace_proxy.py b/neutron/tests/unit/agent/metadata/test_namespace_proxy.py index 8cf8d1415..8403ecaf4 100644 --- a/neutron/tests/unit/agent/metadata/test_namespace_proxy.py +++ b/neutron/tests/unit/agent/metadata/test_namespace_proxy.py @@ -98,7 +98,7 @@ class TestNetworkMetadataProxyHandler(base.BaseTestCase): ) self.assertEqual(retval.headers['Content-Type'], 'text/plain') - self.assertEqual(retval.body, 'content') + self.assertEqual(b'content', retval.body) def test_proxy_request_network_200(self): self.handler.network_id = 'network_id' @@ -129,7 +129,7 @@ class TestNetworkMetadataProxyHandler(base.BaseTestCase): self.assertEqual(retval.headers['Content-Type'], 'application/json') - self.assertEqual(retval.body, '{}') + self.assertEqual(b'{}', retval.body) def _test_proxy_request_network_4xx(self, status, method, expected): self.handler.network_id = 'network_id' diff --git a/tox.ini b/tox.ini index 65d3c68df..b3867cd66 100644 --- a/tox.ini +++ b/tox.ini @@ -177,6 +177,7 @@ commands = python -m testtools.run \ neutron.tests.unit.api.rpc.agentnotifiers.test_dhcp_rpc_agent_api \ neutron.tests.unit.api.v2.test_attributes \ neutron.tests.unit.agent.metadata.test_driver \ + neutron.tests.unit.agent.metadata.test_namespace_proxy \ neutron.tests.unit.agent.test_rpc \ neutron.tests.unit.agent.test_securitygroups_rpc \ neutron.tests.unit.agent.l3.test_link_local_allocator \