diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-23 19:55:33 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-23 19:55:33 +1200 |
commit | 622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd (patch) | |
tree | 8295e8d3b487a605c5051a9abaf16e1840871eae /test/test_pathod.py | |
parent | eba485f5ebef6975c60eb29e69e03aa7598d59b8 (diff) | |
download | mitmproxy-622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd.tar.gz mitmproxy-622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd.tar.bz2 mitmproxy-622a2b560753f2e4aa96bfb4e97bfcac4d0bedbd.zip |
Add a --noweb option to turn web iface off, refactor unit tests.
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r-- | test/test_pathod.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py index 0adba8e6..58477620 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -1,5 +1,6 @@ from libpathod import pathod, version from netlib import tcp, http +import requests import tutils class TestPathod: @@ -26,6 +27,17 @@ class TestPathod: assert len(p.get_log()) <= p.LOGBUF +class TestNoWeb(tutils.DaemonTests): + noweb = True + def setUp(self): + # Over ride log clearing + pass + + def test_noweb(self): + assert self.get("200").status_code == 200 + assert self.getpath("/").status_code == 800 + + class CommonTests(tutils.DaemonTests): def test_sizelimit(self): r = self.get("200:b@1g") @@ -67,7 +79,7 @@ class CommonTests(tutils.DaemonTests): def test_invalid_first_line(self): c = tcp.TCPClient("localhost", self.d.port) c.connect() - if self.SSL: + if self.ssl: c.convert_to_ssl() c.wfile.write("foo\n\n\n") c.wfile.flush() @@ -92,11 +104,11 @@ class CommonTests(tutils.DaemonTests): class TestDaemon(CommonTests): - SSL = False + ssl = False class TestDaemonSSL(CommonTests): - SSL = True + ssl = True def test_ssl_conn_failure(self): c = tcp.TCPClient("localhost", self.d.port) c.rbufsize = 0 |