aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-24 17:47:55 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-24 17:47:55 +1200
commitf8622ea914b506013625c539388349d53b4a7e58 (patch)
treec79d233fb8ce6c17224f80f9086a7c3e4ef3d796 /test
parent75f06d56cd87c9458a758277bdc1905d0637a532 (diff)
downloadmitmproxy-f8622ea914b506013625c539388349d53b4a7e58.tar.gz
mitmproxy-f8622ea914b506013625c539388349d53b4a7e58.tar.bz2
mitmproxy-f8622ea914b506013625c539388349d53b4a7e58.zip
Simple request spec parsing.
Diffstat (limited to 'test')
-rw-r--r--test/test_rparse.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/test_rparse.py b/test/test_rparse.py
index 2b8543a2..2a76c3e8 100644
--- a/test/test_rparse.py
+++ b/test/test_rparse.py
@@ -188,7 +188,13 @@ class TestPauses:
assert r.actions[0] == (10, "pause", 10)
-class TestParse:
+class TestParseRequest:
+ def test_simple(self):
+ r = rparse.parse_request({}, "GET")
+ assert r.method == "GET"
+
+
+class TestParseResponse:
def test_parse_err(self):
tutils.raises(rparse.ParseException, rparse.parse_response, {}, "400:msg,b:")
try:
@@ -199,7 +205,7 @@ class TestParse:
def test_parse_header(self):
r = rparse.parse_response({}, '400:h"foo"="bar"')
- assert r.get_header("foo") == "bar"
+ assert utils.get_header("foo", r.headers)
def test_parse_pause_before(self):
r = rparse.parse_response({}, "400:p10,0")