diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 15:07:45 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-24 15:07:45 +1200 |
commit | 2e558b7e9d435216ff8c4c76df130fbf3936f803 (patch) | |
tree | 53308d5d051022dcd99411ff94214e870f648a8b /test/test_test.py | |
parent | b71e2f6f2bbc3ecaa1e463bae0cc6fd4762c6b8a (diff) | |
download | mitmproxy-2e558b7e9d435216ff8c4c76df130fbf3936f803.tar.gz mitmproxy-2e558b7e9d435216ff8c4c76df130fbf3936f803.tar.bz2 mitmproxy-2e558b7e9d435216ff8c4c76df130fbf3936f803.zip |
Fix disconnect, improve coverage, enable file value specifier.
Diffstat (limited to 'test/test_test.py')
-rw-r--r-- | test/test_test.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/test_test.py b/test/test_test.py index 36d77fd5..7053bd73 100644 --- a/test/test_test.py +++ b/test/test_test.py @@ -44,12 +44,28 @@ class TestDaemon: def tearDownAll(self): self.d.shutdown() + def setUp(self): + self.d.clear_log() + + def get(self, spec): + return requests.get("http://localhost:%s/p/%s"%(self.d.port, spec)) + def test_info(self): assert tuple(self.d.info()["version"]) == version.IVERSION def test_logs(self): - rsp = requests.get("http://localhost:%s/p/202"%self.d.port) + rsp = self.get("202") assert len(self.d.log()) == 1 assert self.d.clear_log() assert len(self.d.log()) == 0 + def test_disconnect(self): + rsp = self.get("202:b@100k:d200") + assert len(rsp.content) < 200 + + def test_parserr(self): + rsp = self.get("400:msg,b:") + assert rsp.status_code == 800 + + + |