From f48073af56c29e8620b04990b724e1adc8920321 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Sun, 5 Jun 2016 23:22:49 +0530 Subject: Py3: Fix status_code and other tests by using byte literals --- test/pathod/test_language_http.py | 14 +++++++------- 1 file 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): -- cgit v1.2.3