diff options
| author | Shadab Zafar <dufferzafar0@gmail.com> | 2016-06-05 23:22:49 +0530 | 
|---|---|---|
| committer | Maximilian Hils <git@maximilianhils.com> | 2016-06-06 11:52:45 -0700 | 
| commit | f48073af56c29e8620b04990b724e1adc8920321 (patch) | |
| tree | c1ac0097dac0037ed9b103aa4e70bdcbbef92951 /test | |
| parent | 5a2932adc11b9049e5609ae564cdee2482ef800c (diff) | |
| download | mitmproxy-f48073af56c29e8620b04990b724e1adc8920321.tar.gz mitmproxy-f48073af56c29e8620b04990b724e1adc8920321.tar.bz2 mitmproxy-f48073af56c29e8620b04990b724e1adc8920321.zip  | |
Py3: Fix status_code and other tests by using byte literals
Diffstat (limited to 'test')
| -rw-r--r-- | test/pathod/test_language_http.py | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/test/pathod/test_language_http.py b/test/pathod/test_language_http.py index 4121dd26..20809fcf 100644 --- a/test/pathod/test_language_http.py +++ b/test/pathod/test_language_http.py @@ -148,18 +148,18 @@ class TestResponse:      def test_response(self):          r = next(language.parse_pathod("400:m'msg'")) -        assert r.status_code.string() == "400" -        assert r.reason.string() == "msg" +        assert r.status_code.string() == b"400" +        assert r.reason.string() == b"msg"          r = next(language.parse_pathod("400:m'msg':b@100b")) -        assert r.reason.string() == "msg" +        assert r.reason.string() == b"msg"          assert r.body.values({})          assert str(r)          r = next(language.parse_pathod("200")) -        assert r.status_code.string() == "200" +        assert r.status_code.string() == b"200"          assert not r.reason -        assert "OK" in [i[:] for i in r.preamble({})] +        assert b"OK" in [i[:] for i in r.preamble({})]      def test_render(self):          s = BytesIO() @@ -176,13 +176,13 @@ class TestResponse:          r = next(language.parse_pathod("400:b'foo'"))          language.serve(r, s, {})          v = s.getvalue() -        assert "Content-Length" in v +        assert b"Content-Length" in v          s = BytesIO()          r = next(language.parse_pathod("400:b'foo':r"))          language.serve(r, s, {})          v = s.getvalue() -        assert "Content-Length" not in v +        assert b"Content-Length" not in v      def test_length(self):          def testlen(x):  | 
