]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Python 3: compare response.body to bytes in namespace_proxy test
authorCedric Brandily <zzelle@gmail.com>
Wed, 29 Jul 2015 11:15:49 +0000 (11:15 +0000)
committerCedric Brandily <zzelle@gmail.com>
Wed, 12 Aug 2015 10:07:14 +0000 (10:07 +0000)
WebOb response bodies should be compared to bytes not string.

Change-Id: I2c17d39cc394a1d583b4f4971c0db9ba1875a0d0
Blueprint: neutron-python3

neutron/tests/unit/agent/metadata/test_namespace_proxy.py
tox.ini

index 8cf8d1415ffa689ebc9163ec967bea2cf76cec60..8403ecaf49078bd612b54f7ee8deadc0df1ca997 100644 (file)
@@ -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 65d3c68dfee14d0cc45f486090ce5e66c2f3cc9c..b3867cd669e2ab83139bfd266b517739fae3ea0d 100644 (file)
--- 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 \