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.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/test_rparse.py b/test/test_rparse.py
index 7c7ffa27..5a3cb53c 100644
--- a/test/test_rparse.py
+++ b/test/test_rparse.py
@@ -24,7 +24,6 @@ class DummyRequest(StringIO.StringIO):
return
-
class uMisc(libpry.AutoTree):
def test_generators(self):
v = rparse.Value.parseString("'val'")[0]
@@ -82,7 +81,6 @@ class uMisc(libpry.AutoTree):
libpry.raises(rparse.ServerError, v.get_generator, dict(staticdir=t))
libpry.raises("no static directory", v.get_generator, dict())
-
def test_generated_value(self):
v = rparse.Value.parseString("!10b")[0]
assert v.usize == 10
@@ -159,8 +157,9 @@ class uMisc(libpry.AutoTree):
class uDisconnects(libpry.AutoTree):
def test_parse(self):
- assert rparse.parse({}, "400:db")
-
+ assert (0, "disconnect") in rparse.parse({}, "400:db").actions
+ assert ("random", "disconnect") in rparse.parse({}, "400:dr").actions
+
def test_before(self):
e = rparse.DisconnectBefore.expr()
v = e.parseString("db")[0]
@@ -178,6 +177,11 @@ class uDisconnects(libpry.AutoTree):
assert isinstance(v, rparse.DisconnectRandom)
+class uShortcutContentType(libpry.AutoTree):
+ def test_parse(self):
+ assert len(rparse.parse({}, "400:c'foo'").headers) == 1
+
+
class uPauses(libpry.AutoTree):
def test_before(self):
e = rparse.PauseBefore.expr()
@@ -307,5 +311,6 @@ tests = [
uPauses(),
uDisconnects(),
uMisc(),
- uparse()
+ uparse(),
+ uShortcutContentType()
]