aboutsummaryrefslogtreecommitdiffstats
path: root/test/tservers.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-02-07 18:14:15 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-02-07 18:14:15 +0100
commit735e4400c4c88c142eeee8b17d798fb688c4280a (patch)
tree4c81d387770e0d7d867557d0130ca962a2389db0 /test/tservers.py
parent545fc2506bdcb4a17705db9bc708d22613ace039 (diff)
downloadmitmproxy-735e4400c4c88c142eeee8b17d798fb688c4280a.tar.gz
mitmproxy-735e4400c4c88c142eeee8b17d798fb688c4280a.tar.bz2
mitmproxy-735e4400c4c88c142eeee8b17d798fb688c4280a.zip
add tests for reconnect to upstream proxy, ensure that server_reconnect is always hooked
Diffstat (limited to 'test/tservers.py')
-rw-r--r--test/tservers.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/tservers.py b/test/tservers.py
index 156796c4..ee84db57 100644
--- a/test/tservers.py
+++ b/test/tservers.py
@@ -254,7 +254,6 @@ class ChainProxTest(ProxTestBase):
Chain n instances of mitmproxy in a row - because we can.
"""
n = 2
- chain = []
chain_config = [lambda: proxy.ProxyConfig(
cacert = tutils.test_data.path("data/serverkey.pem")
)] * n
@@ -262,6 +261,7 @@ class ChainProxTest(ProxTestBase):
@classmethod
def setupAll(cls):
super(ChainProxTest, cls).setupAll()
+ cls.chain = []
for i in range(cls.n):
config = cls.chain_config[i]()
config.forward_proxy = ("http", "127.0.0.1",
@@ -278,6 +278,12 @@ class ChainProxTest(ProxTestBase):
for p in cls.chain:
p.tmaster.server.shutdown()
+ def setUp(self):
+ super(ChainProxTest, self).setUp()
+ for p in self.chain:
+ p.tmaster.clear_log()
+ p.tmaster.state.clear()
+
class HTTPChainProxyTest(ChainProxTest):
def pathoc(self, sni=None):