aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_rparse.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-07-23 19:25:57 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-07-23 19:25:57 +1200
commiteba485f5ebef6975c60eb29e69e03aa7598d59b8 (patch)
tree41463bcedfb05e3ee7655da51327a368e74d0e5a /test/test_rparse.py
parent763e1ff7862e8784170e7c23a015eceaa19e2f70 (diff)
downloadmitmproxy-eba485f5ebef6975c60eb29e69e03aa7598d59b8.tar.gz
mitmproxy-eba485f5ebef6975c60eb29e69e03aa7598d59b8.tar.bz2
mitmproxy-eba485f5ebef6975c60eb29e69e03aa7598d59b8.zip
100% unit test coverage
Diffstat (limited to 'test/test_rparse.py')
-rw-r--r--test/test_rparse.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_rparse.py b/test/test_rparse.py
index 88c1b617..70395bdc 100644
--- a/test/test_rparse.py
+++ b/test/test_rparse.py
@@ -38,6 +38,7 @@ class TestMisc:
assert g[0] == "x"
assert g[-1] == "x"
assert g[0:5] == "xxxxx"
+ assert repr(g)
def test_valueliteral(self):
v = rparse.ValueLiteral("foo")
@@ -47,10 +48,12 @@ class TestMisc:
v = rparse.ValueLiteral(r"foo\n")
assert v.expr()
assert v.val == "foo\n"
+ assert repr(v)
def test_valuenakedliteral(self):
v = rparse.ValueNakedLiteral("foo")
assert v.expr()
+ assert repr(v)
def test_file_value(self):
v = rparse.Value.parseString("<'one two'")[0]
@@ -104,7 +107,9 @@ class TestMisc:
def test_path(self):
e = rparse.Path.expr()
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"