diff options
Diffstat (limited to 'cherrypy/test/test_caching.py')
| -rw-r--r-- | cherrypy/test/test_caching.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cherrypy/test/test_caching.py b/cherrypy/test/test_caching.py index 4a459a3f..1a6ed4f2 100644 --- a/cherrypy/test/test_caching.py +++ b/cherrypy/test/test_caching.py @@ -10,7 +10,6 @@ from six.moves import urllib import pytest import cherrypy -from cherrypy._cpcompat import ntob from cherrypy.lib import httputil from cherrypy.test import helper @@ -18,10 +17,10 @@ from cherrypy.test import helper curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) -gif_bytes = ntob( - 'GIF89a\x01\x00\x01\x00\x82\x00\x01\x99"\x1e\x00\x00\x00\x00\x00' - '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' - '\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x02\x03\x02\x08\t\x00;' +gif_bytes = ( + b'GIF89a\x01\x00\x01\x00\x82\x00\x01\x99"\x1e\x00\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x02\x03\x02\x08\t\x00;' ) @@ -179,7 +178,7 @@ class CacheTest(helper.CPWebCase): self.assertHeader('Content-Encoding', 'gzip') self.assertHeader('Vary') self.assertEqual( - cherrypy.lib.encoding.decompress(self.body), ntob('visit #5')) + cherrypy.lib.encoding.decompress(self.body), b'visit #5') # Now check that a second request gets the gzip header and gzipped body # This also tests a bug in 3.0 to 3.0.2 whereby the cached, gzipped @@ -187,7 +186,7 @@ class CacheTest(helper.CPWebCase): self.getPage('/', method='GET', headers=[('Accept-Encoding', 'gzip')]) self.assertHeader('Content-Encoding', 'gzip') self.assertEqual( - cherrypy.lib.encoding.decompress(self.body), ntob('visit #5')) + cherrypy.lib.encoding.decompress(self.body), b'visit #5') # Now check that a third request that doesn't accept gzip # skips the cache (because the 'Vary' header denies it). |
