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 /docs | |
| parent | 4dcbcc52a21f448e8ee3760e4758067f4e48389c (diff) | |
| download | webtest-804896f44eee5945ba68f459c99e4065baaff0af.tar.gz | |
Remove all references to thte six package
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/testapp.rst | 9 | ||||
| -rw-r--r-- | docs/testresponse.rst | 7 |
2 files changed, 7 insertions, 9 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) |
