aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_rparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_rparse.py')
-rw-r--r--test/test_rparse.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test_rparse.py b/test/test_rparse.py
index 70395bdc..24ca3653 100644
--- a/test/test_rparse.py
+++ b/test/test_rparse.py
@@ -109,13 +109,17 @@ class TestMisc:
assert e.parseString('"/foo"')[0].value.val == "/foo"
e = rparse.Path("/foo")
assert e.value.val == "/foo"
-
+
def test_method(self):
e = rparse.Method.expr()
assert e.parseString("get")[0].value.val == "GET"
assert e.parseString("'foo'")[0].value.val == "foo"
assert e.parseString("'get'")[0].value.val == "get"
+ def test_raw(self):
+ e = rparse.Raw.expr()
+ assert e.parseString("r")[0]
+
def test_body(self):
e = rparse.Body.expr()
v = e.parseString("b'foo'")[0]
@@ -436,6 +440,17 @@ class TestResponse:
r = rparse.parse_response({}, "400'msg'")
assert r.serve(s)
+ def test_raw(self):
+ s = cStringIO.StringIO()
+ r = rparse.parse_response({}, "400:b'foo'")
+ r.serve(s)
+ assert "Content-Length" in s.getvalue()
+
+ s = cStringIO.StringIO()
+ r = rparse.parse_response({}, "400:b'foo':r")
+ r.serve(s)
+ assert not "Content-Length" in s.getvalue()
+
def test_length(self):
def testlen(x):
s = cStringIO.StringIO()