diff options
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r-- | test/test_pathod.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py index 12f7bac0..1f127586 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -3,7 +3,7 @@ import cStringIO import OpenSSL from libpathod import pathod, version -from netlib import tcp, http, http2 +from netlib import tcp, http import tutils @@ -51,7 +51,7 @@ class TestNoApi(tutils.DaemonTests): assert self.getpath("/log").status_code == 404 r = self.getpath("/") assert r.status_code == 200 - assert not "Log" in r.content + assert not "Log" in r.body class TestNotAfterConnect(tutils.DaemonTests): @@ -119,7 +119,7 @@ class TestNocraft(tutils.DaemonTests): def test_nocraft(self): r = self.get(r"200:b'\xf0'") assert r.status_code == 800 - assert "Crafting disabled" in r.content + assert "Crafting disabled" in r.body class CommonTests(tutils.DaemonTests): @@ -152,7 +152,7 @@ class CommonTests(tutils.DaemonTests): def test_disconnect(self): rsp = self.get("202:b@100k:d200") - assert len(rsp.content) < 200 + assert len(rsp.body) < 200 def test_parserr(self): rsp = self.get("400:msg,b:") @@ -161,7 +161,7 @@ class CommonTests(tutils.DaemonTests): def test_static(self): rsp = self.get("200:b<file") assert rsp.status_code == 200 - assert rsp.content.strip() == "testfile" + assert rsp.body.strip() == "testfile" def test_anchor(self): rsp = self.getpath("anchor/foo") @@ -201,7 +201,7 @@ class CommonTests(tutils.DaemonTests): def test_source_access_denied(self): rsp = self.get("200:b</foo") assert rsp.status_code == 800 - assert "File access denied" in rsp.content + assert "File access denied" in rsp.body def test_proxy(self): r, _ = self.pathoc([r"get:'http://foo.com/p/202':da"]) @@ -284,5 +284,4 @@ class TestHTTP2(tutils.DaemonTests): def test_http2(self): r, _ = self.pathoc(["GET:/"], ssl=True, use_http2=True) - print(r) assert r[0].status_code == "800" |