diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-21 14:14:31 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-21 14:14:31 +1200 |
commit | 5577d85ce6835fddce6e0eaf98b241e42e959a25 (patch) | |
tree | 5944d66dc039615658964cd45d016253ac97db30 /test/test_pathod.py | |
parent | 8ec44c627770e5a41faabbf724ad54ed518e08f6 (diff) | |
download | mitmproxy-5577d85ce6835fddce6e0eaf98b241e42e959a25.tar.gz mitmproxy-5577d85ce6835fddce6e0eaf98b241e42e959a25.tar.bz2 mitmproxy-5577d85ce6835fddce6e0eaf98b241e42e959a25.zip |
Use injection to test a corner case in pathod daemon.
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r-- | test/test_pathod.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py index 9f01b25c..a23b7c71 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -1,5 +1,5 @@ import requests -from libpathod import pathod, test, version +from libpathod import pathod, test, version, pathoc from netlib import tcp import tutils @@ -64,6 +64,17 @@ class _DaemonTests: scheme = "https" if self.SSL else "http" return requests.get("%s://localhost:%s/p/%s"%(scheme, self.d.port, spec), verify=False) + def pathoc(self, spec): + c = pathoc.Pathoc("localhost", self.d.port) + c.connect() + if self.SSL: + c.convert_to_ssl() + return c.request(spec) + + def test_preline(self): + v = self.pathoc(r"get:'/p/200':i0,'\r\n'") + assert v[1] == 200 + def test_info(self): assert tuple(self.d.info()["version"]) == version.IVERSION |