aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_cmdline.py18
-rw-r--r--test/test_proxy.py12
-rw-r--r--test/tservers.py6
3 files changed, 26 insertions, 10 deletions
diff --git a/test/test_cmdline.py b/test/test_cmdline.py
index 12e8aa89..476fc620 100644
--- a/test/test_cmdline.py
+++ b/test/test_cmdline.py
@@ -1,7 +1,6 @@
import argparse
from libmproxy import cmdline
import tutils
-import os.path
def test_parse_replace_hook():
@@ -51,6 +50,7 @@ def test_parse_setheaders():
x = cmdline.parse_setheader("/foo/bar/voing")
assert x == ("foo", "bar", "voing")
+
def test_common():
parser = argparse.ArgumentParser()
cmdline.common_options(parser)
@@ -108,3 +108,19 @@ def test_common():
assert len(v) == 1
assert v[0][2].strip() == "replacecontents"
+
+def test_mitmproxy():
+ ap = cmdline.mitmproxy()
+ assert ap
+
+
+def test_mitmdump():
+ ap = cmdline.mitmdump()
+ assert ap
+
+
+def test_mitmweb():
+ ap = cmdline.mitmweb()
+ assert ap
+
+
diff --git a/test/test_proxy.py b/test/test_proxy.py
index c396183b..641b4f47 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -70,9 +70,9 @@ class TestProcessProxyOptions:
def test_simple(self):
assert self.p()
- def test_confdir(self):
- with tutils.tmpdir() as confdir:
- self.assert_noerr("--confdir", confdir)
+ def test_cadir(self):
+ with tutils.tmpdir() as cadir:
+ self.assert_noerr("--cadir", cadir)
@mock.patch("libmproxy.platform.resolver", None)
def test_no_transparent(self):
@@ -94,12 +94,12 @@ class TestProcessProxyOptions:
self.assert_err("mutually exclusive", "-R", "http://localhost", "-T")
def test_client_certs(self):
- with tutils.tmpdir() as confdir:
- self.assert_noerr("--client-certs", confdir)
+ with tutils.tmpdir() as cadir:
+ self.assert_noerr("--client-certs", cadir)
self.assert_err("directory does not exist", "--client-certs", "nonexistent")
def test_certs(self):
- with tutils.tmpdir() as confdir:
+ with tutils.tmpdir() as cadir:
self.assert_noerr("--cert", tutils.test_data.path("data/testkey.pem"))
self.assert_err("does not exist", "--cert", "nonexistent")
diff --git a/test/tservers.py b/test/tservers.py
index 93c8a80a..12154ba7 100644
--- a/test/tservers.py
+++ b/test/tservers.py
@@ -99,7 +99,7 @@ class ProxTestBase(object):
@classmethod
def teardownAll(cls):
- shutil.rmtree(cls.confdir)
+ shutil.rmtree(cls.cadir)
cls.proxy.shutdown()
cls.server.shutdown()
cls.server2.shutdown()
@@ -116,10 +116,10 @@ class ProxTestBase(object):
@classmethod
def get_proxy_config(cls):
- cls.confdir = os.path.join(tempfile.gettempdir(), "mitmproxy")
+ cls.cadir = os.path.join(tempfile.gettempdir(), "mitmproxy")
return dict(
no_upstream_cert = cls.no_upstream_cert,
- confdir = cls.confdir,
+ cadir = cls.cadir,
authenticator = cls.authenticator,
certforward = cls.certforward,
ssl_ports=([cls.server.port, cls.server2.port] if cls.ssl else []),