Fix test incompatibilities with py35

This fixes 4 tests not handling bytes properly.

Change-Id: Ib35528af7da3e3eff17b0ce7995daaa263736748
Depends-On: Ifc249f36c8bb9718f4d4557acc9b0181e491b31b
This commit is contained in:
Thomas Herve 2017-07-25 09:31:02 +02:00
parent 6583b5f1ac
commit 945b9c6db1
4 changed files with 4 additions and 4 deletions

View File

@ -66,7 +66,7 @@ class DnsClientBase(rest_client.RestClient):
if 'application/json' in resp['content-type']:
return json.loads(object_str)
elif 'text/dns' in resp['content-type']:
return models.ZoneFile.from_text(object_str)
return models.ZoneFile.from_text(object_str.decode("utf-8"))
else:
raise lib_exc.InvalidContentType()

View File

@ -61,7 +61,7 @@ class QuotasAdminTest(BaseQuotasTest):
_, body = self.admin_client.delete_quotas()
LOG.info("Ensuring an empty response body")
self.assertEqual(body.strip(), "")
self.assertEqual(body.strip(), b"")
@decorators.idempotent_id('4f2b65b7-c4e1-489c-9047-755e42ba0985')
def test_update_quotas(self):

View File

@ -70,7 +70,7 @@ class BlacklistsAdminTest(BaseBlacklistsTest):
_, body = self.admin_client.delete_blacklist(blacklist['id'])
# A blacklist delete returns an empty body
self.assertEqual(body.strip(), "")
self.assertEqual(body.strip(), b"")
@decorators.idempotent_id('3a2a1e6c-8176-428c-b5dd-d85217c0209d')
def test_list_blacklists(self):

View File

@ -63,7 +63,7 @@ class QuotasV2Test(base.BaseDnsV2Test):
_, body = self.admin_client.delete_quotas()
LOG.info("Ensuring an empty response body")
self.assertEqual(body.strip(), "")
self.assertEqual(body.strip(), b"")
@decorators.idempotent_id('76d24c87-1b39-4e19-947c-c08e1380dc61')
def test_update_quotas(self):