aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_language.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-10-29 17:33:10 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-10-29 17:33:10 +1300
commit3e0cd6442aa3dd5ecc08af4851e68545121737ab (patch)
tree0333c96ae35d6d869ced4a7719174dee4aa5dd76 /test/test_language.py
parent747eafd10703d5a93003e410469771f883df68b5 (diff)
downloadmitmproxy-3e0cd6442aa3dd5ecc08af4851e68545121737ab.tar.gz
mitmproxy-3e0cd6442aa3dd5ecc08af4851e68545121737ab.tar.bz2
mitmproxy-3e0cd6442aa3dd5ecc08af4851e68545121737ab.zip
Add .spec methods for Request and Response objects.
Diffstat (limited to 'test/test_language.py')
-rw-r--r--test/test_language.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_language.py b/test/test_language.py
index c453766c..219b2909 100644
--- a/test/test_language.py
+++ b/test/test_language.py
@@ -406,6 +406,13 @@ class TestParseRequest:
assert r.path.string().endswith("bar")
assert r.actions
+ def test_spec(self):
+ def rt(s):
+ s = language.parse_request({}, s).spec()
+ assert language.parse_request({}, s).spec() == s
+ rt("get:/foo")
+ rt("get:/foo:da")
+
class TestParseResponse:
def test_parse_err(self):
@@ -439,6 +446,14 @@ class TestParseResponse:
r = language.parse_response({}, "400:b@100g")
assert r.length({}, None)
+ def test_spec(self):
+ def rt(s):
+ s = language.parse_response({}, s).spec()
+ assert language.parse_response({}, s).spec() == s
+ rt("400:b@100g")
+ rt("400")
+ rt("400:da")
+
class TestWriteValues:
def test_send_chunk(self):