aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pathod.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-07-24 17:43:41 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-07-24 17:43:41 +0200
commitf8b4d666870163d6770aabefe212b8ecd981d490 (patch)
tree8c6f2fc9ef4c06c40a04514f651785540d278bf3 /test/test_pathod.py
parent9a1bee31d6d7b92bf5b4cb68d853c856acdfb036 (diff)
parent96c9c4459f0bb9b76ab34f8c8d03d0e5d28621f4 (diff)
downloadmitmproxy-f8b4d666870163d6770aabefe212b8ecd981d490.tar.gz
mitmproxy-f8b4d666870163d6770aabefe212b8ecd981d490.tar.bz2
mitmproxy-f8b4d666870163d6770aabefe212b8ecd981d490.zip
Merge pull request #31 from Kriechi/protocol-refactor
HTTP protocol refactoring
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r--test/test_pathod.py13
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"