minor fixes

This commit is contained in:
Aldo Cortesi 2018-04-03 09:54:29 +12:00
parent 7e73e5fa51
commit 659fceb697
2 changed files with 4 additions and 10 deletions

View File

@ -6,7 +6,6 @@ import tempfile
import traceback import traceback
import pytest import pytest
import h2 import h2
import time
from mitmproxy import options from mitmproxy import options

View File

@ -14,6 +14,7 @@ from mitmproxy import controller
from mitmproxy import options from mitmproxy import options
from mitmproxy import exceptions from mitmproxy import exceptions
from mitmproxy import io from mitmproxy import io
from mitmproxy.utils import human
import pathod.test import pathod.test
import pathod.pathoc import pathod.pathoc
@ -111,10 +112,7 @@ class ProxyThread(threading.Thread):
asyncio.set_event_loop(self.event_loop) asyncio.set_event_loop(self.event_loop)
self.tmaster = self.masterclass(self.options) self.tmaster = self.masterclass(self.options)
self.tmaster.addons.add(core.Core()) self.tmaster.addons.add(core.Core())
self.name = "ProxyThread (%s:%s)" % ( self.name = "ProxyThread (%s)" % human.format_address(self.tmaster.server.address)
self.tmaster.server.address[0],
self.tmaster.server.address[1],
)
self.tmaster.run() self.tmaster.run()
def set_addons(self, *addons): def set_addons(self, *addons):
@ -362,11 +360,8 @@ class HTTPUpstreamProxyTest(HTTPProxyTest):
proxy = ProxyThread(cls.masterclass, opts) proxy = ProxyThread(cls.masterclass, opts)
proxy.start() proxy.start()
cls.chain.insert(0, proxy) cls.chain.insert(0, proxy)
while 1: while True:
if( if proxy.event_loop and proxy.event_loop.is_running():
proxy.event_loop and
proxy.event_loop.is_running()
):
break break
super().setup_class() super().setup_class()