Skip to content

Commit

Permalink
In tests, run mitmdump with a specific (empty) config file
Browse files Browse the repository at this point in the history
Avoid the user's own config from ~/.mitmproxy
  • Loading branch information
vfaronov committed Feb 28, 2017
1 parent d6feb0e commit 3fab4e5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test_real_mitmdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ def __init__(self):
self.port = random.randint(1024, 65535)

def start(self):
config_path = os.path.join(
os.path.dirname(__file__), 'tools', 'mitmproxy-config')
fd, self.report_path = tempfile.mkstemp()
os.close(fd)
script_path = subprocess.check_output(
['python3', '-m', 'mitmproxy_httpolice']).decode().strip()
self.process = subprocess.Popen([
'mitmdump', '-p', str(self.port), '-s',
"'%s' '%s'" % (script_path, self.report_path)
'mitmdump', '--conf', config_path,
'-p', str(self.port),
'-s', "'%s' '%s'" % (script_path, self.report_path)
])
time.sleep(5) # Give it some time to get up and running

Expand Down
Empty file added tools/mitmproxy-config
Empty file.

0 comments on commit 3fab4e5

Please sign in to comment.