aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_cmdline.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-03-10 05:11:51 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-03-10 05:11:51 +0100
commitfe58c1c6eb16fdc14bd24843cb896b3d8a4eefc8 (patch)
tree0587a4a1a7351d313454a72ce237694c6523ff96 /test/test_cmdline.py
parent78750a8b4da217a2b3f3eac23bea92b6c428fc35 (diff)
downloadmitmproxy-fe58c1c6eb16fdc14bd24843cb896b3d8a4eefc8.tar.gz
mitmproxy-fe58c1c6eb16fdc14bd24843cb896b3d8a4eefc8.tar.bz2
mitmproxy-fe58c1c6eb16fdc14bd24843cb896b3d8a4eefc8.zip
add advanced proxying options, add SSL-terminating capability to mitmproxy
Diffstat (limited to 'test/test_cmdline.py')
-rw-r--r--test/test_cmdline.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_cmdline.py b/test/test_cmdline.py
index dbc61bfc..12e8aa89 100644
--- a/test/test_cmdline.py
+++ b/test/test_cmdline.py
@@ -36,6 +36,17 @@ def test_parse_replace_hook():
)
+def test_parse_server_spec():
+ tutils.raises("Invalid server specification", cmdline.parse_server_spec, "")
+ assert cmdline.parse_server_spec("http://foo.com:88") == [False, False, "foo.com", 88]
+ assert cmdline.parse_server_spec("http://foo.com") == [False, False, "foo.com", 80]
+ assert cmdline.parse_server_spec("https://foo.com") == [True, True, "foo.com", 443]
+ assert cmdline.parse_server_spec("https2http://foo.com") == [True, False, "foo.com", 80]
+ assert cmdline.parse_server_spec("http2https://foo.com") == [False, True, "foo.com", 443]
+ tutils.raises("Invalid server specification", cmdline.parse_server_spec, "foo.com")
+ tutils.raises("Invalid server specification", cmdline.parse_server_spec, "http://")
+
+
def test_parse_setheaders():
x = cmdline.parse_setheader("/foo/bar/voing")
assert x == ("foo", "bar", "voing")