From 735e4400c4c88c142eeee8b17d798fb688c4280a Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 7 Feb 2014 18:14:15 +0100 Subject: add tests for reconnect to upstream proxy, ensure that server_reconnect is always hooked --- test/tservers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/tservers.py') 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): -- cgit v1.2.3