diff options
author | Boris Staletic <boris.staletic@gmail.com> | 2020-12-17 01:05:05 +0100 |
---|---|---|
committer | Boris Staletic <boris.staletic@gmail.com> | 2020-12-17 01:05:05 +0100 |
commit | 804896f44eee5945ba68f459c99e4065baaff0af (patch) | |
tree | 4bbc435697af8818cbf20b9c5861622d59e634ea | |
parent | 4dcbcc52a21f448e8ee3760e4758067f4e48389c (diff) | |
download | webtest-804896f44eee5945ba68f459c99e4065baaff0af.tar.gz |
Remove all references to thte six package
-rw-r--r-- | docs/testapp.rst | 9 | ||||
-rw-r--r-- | docs/testresponse.rst | 7 | ||||
-rw-r--r-- | tests/test_lint.py | 2 | ||||
-rw-r--r-- | webtest/utils.py | 1 |
4 files changed, 8 insertions, 11 deletions
diff --git a/docs/testapp.rst b/docs/testapp.rst index ba99baa..e8d3b47 100644 --- a/docs/testapp.rst +++ b/docs/testapp.rst @@ -3,7 +3,6 @@ TestApp .. >>> import json - >>> import six >>> import sys >>> from webtest.app import TestApp >>> from webob import Request @@ -12,16 +11,16 @@ TestApp ... req = Request(environ) ... if req.path_info.endswith('.html'): ... content_type = 'text/html' - ... body = six.b('<html><body><div id="content">hey!</div></body>') + ... body = '<html><body><div id="content">hey!</div></body>'.encode('latin-1') ... elif req.path_info.endswith('.xml'): ... content_type = 'text/xml' - ... body = six.b('<xml><message>hey!</message></xml>') + ... body = '<xml><message>hey!</message></xml>'.encode('latin-1') ... elif req.path_info.endswith('.json'): ... content_type = 'application/json' - ... body = six.b(json.dumps({"a": 1, "b": 2})) + ... body = json.dumps({"a": 1, "b": 2}).encode('latin-1') ... elif '/resource/' in req.path_info: ... content_type = 'application/json' - ... body = six.b(json.dumps(dict(id=1, value='value'))) + ... body = json.dumps(dict(id=1, value='value')).encode('latin-1') ... resp = Response(body, content_type=content_type) ... return resp(environ, start_response) >>> app = TestApp(application) diff --git a/docs/testresponse.rst b/docs/testresponse.rst index 8287283..7e27a26 100644 --- a/docs/testresponse.rst +++ b/docs/testresponse.rst @@ -3,7 +3,6 @@ TestResponse .. >>> import json - >>> import six >>> import sys >>> from webob import Request >>> from webob import Response @@ -12,13 +11,13 @@ TestResponse ... req = Request(environ) ... if req.path_info.endswith('.html'): ... content_type = 'text/html' - ... body = six.b('<html><body><div id="content">hey!</div></body>') + ... body = '<html><body><div id="content">hey!</div></body>'.encode('latin-1') ... elif req.path_info.endswith('.xml'): ... content_type = 'text/xml' - ... body = six.b('<xml><message>hey!</message></xml>') + ... body = '<xml><message>hey!</message></xml>'.encode('latin-1') ... elif req.path_info.endswith('.json'): ... content_type = 'application/json' - ... body = six.b(json.dumps({"a": 1, "b": 2})) + ... body = json.dumps({"a": 1, "b": 2}).encode('latin-1') ... resp = Response(body, content_type=content_type) ... return resp(environ, start_response) >>> app = TestApp(application) diff --git a/tests/test_lint.py b/tests/test_lint.py index e263321..ae6b8ae 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -19,7 +19,7 @@ from webtest.lint import to_string from webtest.lint import middleware from webtest.lint import _assert_latin1_str -from six import BytesIO +from io import BytesIO def application(environ, start_response): diff --git a/webtest/utils.py b/webtest/utils.py index a5fe3cf..e99df59 100644 --- a/webtest/utils.py +++ b/webtest/utils.py @@ -1,5 +1,4 @@ import re -import six from json import dumps from webtest.compat import urlencode |