diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 16:20:50 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 16:20:50 +1200 |
commit | e6aa9ff67582c00d2de03f65b47dd776cd602fb7 (patch) | |
tree | 17015dd564bfeb15a9cf2bf2d63641a1032b94ae /test | |
parent | 877b5a2d116c1ee0a8eb26191a65ff87f7146ae0 (diff) | |
download | mitmproxy-e6aa9ff67582c00d2de03f65b47dd776cd602fb7.tar.gz mitmproxy-e6aa9ff67582c00d2de03f65b47dd776cd602fb7.tar.bz2 mitmproxy-e6aa9ff67582c00d2de03f65b47dd776cd602fb7.zip |
Re-enable anchors.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_pathod.py | 6 | ||||
-rw-r--r-- | test/test_test.py | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py index 966ae12e..e00694cd 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -15,7 +15,11 @@ class _TestApplication: class TestPathod: def test_instantiation(self): - p = pathod.Pathod(("127.0.0.1", 0)) + p = pathod.Pathod( + ("127.0.0.1", 0), + anchors = [(".*", "200")] + ) + assert p.anchors def test_logging(self): p = pathod.Pathod(("127.0.0.1", 0)) diff --git a/test/test_test.py b/test/test_test.py index b9a9cfac..dcf980bc 100644 --- a/test/test_test.py +++ b/test/test_test.py @@ -38,7 +38,10 @@ class TestDaemonManual: class TestDaemon: @classmethod def setUpAll(self): - self.d = test.Daemon(staticdir=tutils.test_data.path("data")) + self.d = test.Daemon( + staticdir=tutils.test_data.path("data"), + anchors=[("/anchor/.*", "202")] + ) @classmethod def tearDownAll(self): @@ -47,6 +50,9 @@ class TestDaemon: def setUp(self): self.d.clear_log() + def getpath(self, path): + return requests.get("http://localhost:%s/%s"%(self.d.port, path)) + def get(self, spec): return requests.get("http://localhost:%s/p/%s"%(self.d.port, spec)) @@ -72,5 +78,7 @@ class TestDaemon: assert rsp.status_code == 200 assert rsp.content.strip() == "testfile" - + def test_anchor(self): + rsp = self.getpath("anchor/foo") + assert rsp.status_code == 202 |