diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-29 14:59:54 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-29 14:59:54 +1200 |
commit | fd946f0c04c2471ab9e579087af3f4cb645be41a (patch) | |
tree | 65c9b2f20d0d5a4ba9569435d6b5f0cad053f10e /test | |
parent | 6d4500c67943d03cf0910256ef9dab46789f366f (diff) | |
download | mitmproxy-fd946f0c04c2471ab9e579087af3f4cb645be41a.tar.gz mitmproxy-fd946f0c04c2471ab9e579087af3f4cb645be41a.tar.bz2 mitmproxy-fd946f0c04c2471ab9e579087af3f4cb645be41a.zip |
Basic logging.
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'")) |