From 3612e7ca76af1b48450ddb60e4005960960e9cc4 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 30 Jul 2017 01:49:56 +0200 Subject: fix tool-specific cmdline before this commit, all tools only exposed mitmdump cmdline arguments, as run() contained a simple `cmdline.mitmdump()` invocation. This fixes this, and also makes it possible to have cmdline arguments for tool-specific options. --- test/mitmproxy/tools/console/conftest.py | 9 --------- test/mitmproxy/tools/test_cmdline.py | 8 ++++++-- 2 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 test/mitmproxy/tools/console/conftest.py (limited to 'test') diff --git a/test/mitmproxy/tools/console/conftest.py b/test/mitmproxy/tools/console/conftest.py deleted file mode 100644 index afd94c6a..00000000 --- a/test/mitmproxy/tools/console/conftest.py +++ /dev/null @@ -1,9 +0,0 @@ -from unittest import mock - -import pytest - - -@pytest.fixture(scope="module", autouse=True) -def definitely_atty(): - with mock.patch("sys.stdout.isatty", lambda: True): - yield diff --git a/test/mitmproxy/tools/test_cmdline.py b/test/mitmproxy/tools/test_cmdline.py index 65cfeb07..e247dc1d 100644 --- a/test/mitmproxy/tools/test_cmdline.py +++ b/test/mitmproxy/tools/test_cmdline.py @@ -1,7 +1,8 @@ import argparse -from mitmproxy.tools import cmdline -from mitmproxy.tools import main + from mitmproxy import options +from mitmproxy.tools import cmdline, web, dump, console +from mitmproxy.tools import main def test_common(): @@ -14,17 +15,20 @@ def test_common(): def test_mitmproxy(): opts = options.Options() + console.master.ConsoleMaster(opts) ap = cmdline.mitmproxy(opts) assert ap def test_mitmdump(): opts = options.Options() + dump.DumpMaster(opts) ap = cmdline.mitmdump(opts) assert ap def test_mitmweb(): opts = options.Options() + web.master.WebMaster(opts) ap = cmdline.mitmweb(opts) assert ap -- cgit v1.2.3