diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_app.py | 12 | ||||
-rw-r--r-- | test/test_rparse.py | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/test/test_app.py b/test/test_app.py index e0060e82..721b36d7 100644 --- a/test/test_app.py +++ b/test/test_app.py @@ -14,6 +14,18 @@ class uApplication(libpry.AutoTree): a.remove_anchor("/oink", "400") assert a.get_anchors() == [("/foo", "200")] + def test_logs(self): + a = app.PathodApp(staticdir=None) + a.LOGBUF = 3 + a.add_log({}) + assert a.log[0]["id"] == 0 + a.add_log({}) + a.add_log({}) + assert a.log[0]["id"] == 2 + a.add_log({}) + assert len(a.log) == 3 + assert a.log[0]["id"] == 3 + assert a.log[-1]["id"] == 1 class uPages(libpry.AutoTree): def dummy_page(self, path): diff --git a/test/test_rparse.py b/test/test_rparse.py index 67fac11e..f9c07eec 100644 --- a/test/test_rparse.py +++ b/test/test_rparse.py @@ -152,7 +152,7 @@ class uMisc(libpry.AutoTree): def test_internal_response(self): d = DummyRequest() s = rparse.InternalResponse(400, "foo") - s.render(d) + s.serve(d) class uDisconnects(libpry.AutoTree): @@ -296,12 +296,12 @@ class uResponse(libpry.AutoTree): def test_render(self): s = DummyRequest() r = rparse.parse({}, "400'msg'") - r.render(s) + assert r.serve(s) def test_length(self): def testlen(x): s = DummyRequest() - x.render(s) + x.serve(s) assert x.length() == len(s.getvalue()) testlen(rparse.parse({}, "400'msg'")) testlen(rparse.parse({}, "400'msg':h'foo'='bar'")) |