diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-04 16:37:50 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-04 16:37:50 +0200 |
commit | 795e19f6b7803f18a3bf5e8111493ed54a3d2e00 (patch) | |
tree | b30b6d7d8eff27f5826530774bb6870303c3a89e /test/tservers.py | |
parent | f4d4332472c7fa68014996a1d55b37911d1515f9 (diff) | |
download | mitmproxy-795e19f6b7803f18a3bf5e8111493ed54a3d2e00.tar.gz mitmproxy-795e19f6b7803f18a3bf5e8111493ed54a3d2e00.tar.bz2 mitmproxy-795e19f6b7803f18a3bf5e8111493ed54a3d2e00.zip |
coverage++
Diffstat (limited to 'test/tservers.py')
-rw-r--r-- | test/tservers.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/tservers.py b/test/tservers.py index 9f2abbe1..91743903 100644 --- a/test/tservers.py +++ b/test/tservers.py @@ -263,6 +263,29 @@ class ReverseProxTest(ProxTestBase): return p.request(q) +class IgnoreProxTest(ProxTestBase): + ssl = True + + @classmethod + def get_proxy_config(cls): + d = super(IgnoreProxTest, cls).get_proxy_config() + d["ignore"] = [".+:%s" % cls.server.port] # ignore by port + return d + + def pathoc_raw(self): + return libpathod.pathoc.Pathoc(("127.0.0.1", self.proxy.port), ssl=self.ssl) + + def pathocs(self): + """ + Returns a (pathod_ignore, pathoc_normal) tuple. + """ + p_ignore = self.pathoc_raw() + p_ignore.connect(("127.0.0.1", self.server.port)) + p_normal = self.pathoc_raw() + p_normal.connect(("127.0.0.1", self.server2.port)) + return p_ignore, p_normal + + class ChainProxTest(ProxTestBase): """ Chain n instances of mitmproxy in a row - because we can. |