This commit is contained in:
Thomas Kriechbaumer 2016-07-17 18:17:35 +02:00
parent d9021f8505
commit 7b57c2948e
1 changed files with 12 additions and 12 deletions

View File

@ -87,31 +87,31 @@ class _Http2ServerBase(netlib_tservers.ServerTestBase):
class _Http2TestBase(object): class _Http2TestBase(object):
@classmethod @classmethod
def setup_class(self): def setup_class(cls):
self.config = ProxyConfig(**self.get_proxy_config()) cls.config = ProxyConfig(**cls.get_proxy_config())
tmaster = tservers.TestMaster(self.config) tmaster = tservers.TestMaster(cls.config)
tmaster.start_app(APP_HOST, APP_PORT) tmaster.start_app(APP_HOST, APP_PORT)
self.proxy = tservers.ProxyThread(tmaster) cls.proxy = tservers.ProxyThread(tmaster)
self.proxy.start() cls.proxy.start()
@classmethod @classmethod
def teardown_class(cls): def teardown_class(cls):
cls.proxy.shutdown() cls.proxy.shutdown()
@property
def master(self):
return self.proxy.tmaster
@classmethod @classmethod
def get_proxy_config(cls): def get_proxy_config(cls):
cls.cadir = os.path.join(tempfile.gettempdir(), "mitmproxy") cls.cadir = os.path.join(tempfile.gettempdir(), "mitmproxy")
return dict( return dict(
no_upstream_cert = False, no_upstream_cert=False,
cadir = cls.cadir, cadir=cls.cadir,
authenticator = None, authenticator=None,
) )
@property
def master(self):
return self.proxy.tmaster
def setup(self): def setup(self):
self.master.clear_log() self.master.clear_log()
self.master.state.clear() self.master.state.clear()