aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-10-28 22:18:06 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-10-28 22:18:06 +1300
commit61f8992fbffac936ac058b64ed7ac00f21127df9 (patch)
tree9f3e3280d538a7837092d5b15e8d97d495a56d7b /test
parent07560ffe307f13ffb5a8fa4ef593902cc69807b9 (diff)
downloadmitmproxy-61f8992fbffac936ac058b64ed7ac00f21127df9.tar.gz
mitmproxy-61f8992fbffac936ac058b64ed7ac00f21127df9.tar.bz2
mitmproxy-61f8992fbffac936ac058b64ed7ac00f21127df9.zip
Change response spec format to code[:features]
Reason message is now specified as just another feature with the "m" mnemonic.
Diffstat (limited to 'test')
-rw-r--r--test/test_language.py14
-rw-r--r--test/test_pathod.py1
2 files changed, 7 insertions, 8 deletions
diff --git a/test/test_language.py b/test/test_language.py
index 0d7c60da..0d3f2685 100644
--- a/test/test_language.py
+++ b/test/test_language.py
@@ -498,11 +498,11 @@ class TestResponse:
assert r.code.string() == "202"
def test_response(self):
- r = language.parse_response({}, "400'msg'")
+ r = language.parse_response({}, "400:m'msg'")
assert r.code.string() == "400"
assert r.reason.string() == "msg"
- r = language.parse_response({}, "400'msg':b@100b")
+ r = language.parse_response({}, "400:m'msg':b@100b")
assert r.reason.string() == "msg"
assert r.body.values({})
assert str(r)
@@ -514,7 +514,7 @@ class TestResponse:
def test_render(self):
s = cStringIO.StringIO()
- r = language.parse_response({}, "400'msg'")
+ r = language.parse_response({}, "400:m'msg'")
assert r.serve(s, {})
def test_raw(self):
@@ -537,9 +537,9 @@ class TestResponse:
s = cStringIO.StringIO()
x.serve(s, {})
assert x.length({}, None) == len(s.getvalue())
- testlen(language.parse_response({}, "400'msg'"))
- testlen(language.parse_response({}, "400'msg':h'foo'='bar'"))
- testlen(language.parse_response({}, "400'msg':h'foo'='bar':b@100b"))
+ testlen(language.parse_response({}, "400:m'msg'"))
+ testlen(language.parse_response({}, "400:m'msg':h'foo'='bar'"))
+ testlen(language.parse_response({}, "400:m'msg':h'foo'='bar':b@100b"))
def test_maximum_length(self):
def testlen(x, actions):
@@ -548,7 +548,7 @@ class TestResponse:
x.serve(s, {})
assert m >= len(s.getvalue())
- r = language.parse_response({}, "400'msg':b@100")
+ r = language.parse_response({}, "400:m'msg':b@100")
actions = [
language.DisconnectAt(0)
diff --git a/test/test_pathod.py b/test/test_pathod.py
index 3fe7e848..30498c3a 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -40,7 +40,6 @@ class TestTimeout(tutils.DaemonTests):
# FIXME: Add float values to spec language, reduce test timeout to
# increase test performance
assert self.get("200:p1,1").status_code == 200
- print self.d.last_log()
assert self.d.last_log()["type"] == "timeout"