Merge "Python3: fix test_client_redirects.py"

This commit is contained in:
Jenkins 2016-12-19 22:19:48 +00:00 committed by Gerrit Code Review
commit a4d261daa5
2 changed files with 7 additions and 6 deletions

View File

@ -99,7 +99,7 @@ class TestClientRedirects(functional.FunctionalTest):
"""
response = self.client.do_request("GET", "/")
self.assertEqual(http.OK, response.status)
self.assertEqual("root", response.read())
self.assertEqual(b"root", response.read())
def test_get_with_one_redirect(self):
"""
@ -107,7 +107,7 @@ class TestClientRedirects(functional.FunctionalTest):
"""
response = self.client.do_request("GET", "/302")
self.assertEqual(http.OK, response.status)
self.assertEqual("success_from_host_one", response.read())
self.assertEqual(b"success_from_host_one", response.read())
def test_get_with_one_redirect_query_string(self):
"""
@ -116,7 +116,7 @@ class TestClientRedirects(functional.FunctionalTest):
response = self.client.do_request("GET", "/302",
params={'with_qs': 'yes'})
self.assertEqual(http.OK, response.status)
self.assertEqual("success_with_qs", response.read())
self.assertEqual(b"success_with_qs", response.read())
def test_get_with_max_redirects(self):
"""
@ -133,7 +133,7 @@ class TestClientRedirects(functional.FunctionalTest):
"""
response = self.client.do_request("POST", "/302")
self.assertEqual(http.OK, response.status)
self.assertEqual("success_from_host_one", response.read())
self.assertEqual(b"success_from_host_one", response.read())
def test_redirect_to_new_host(self):
"""
@ -143,8 +143,8 @@ class TestClientRedirects(functional.FunctionalTest):
response = self.client.do_request("POST", url)
self.assertEqual(http.OK, response.status)
self.assertEqual("success_from_host_two", response.read())
self.assertEqual(b"success_from_host_two", response.read())
response = self.client.do_request("POST", "/success")
self.assertEqual(http.OK, response.status)
self.assertEqual("success_from_host_one", response.read())
self.assertEqual(b"success_from_host_one", response.read())

View File

@ -32,6 +32,7 @@ commands = oslo_debug_helper {posargs}
commands =
lockutils-wrapper python setup.py testr --slowest --testr-args='glance.tests.unit'
python -m testtools.run \
glance.tests.functional.test_client_redirects \
glance.tests.functional.test_gzip_middleware \
glance.tests.functional.test_client_exceptions \
glance.tests.functional.test_sqlite \