diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-30 12:03:28 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-30 12:03:28 +1200 |
commit | a05a70d8168a07c92b2a3ecbbb1958d85532efe3 (patch) | |
tree | bc2cc0b89d05e8213280a460cbf25978583c8337 /test/test_cmdline.py | |
parent | 1a106f4080d89a236a193f2cb007a00aa195a1ad (diff) | |
download | mitmproxy-a05a70d8168a07c92b2a3ecbbb1958d85532efe3.tar.gz mitmproxy-a05a70d8168a07c92b2a3ecbbb1958d85532efe3.tar.bz2 mitmproxy-a05a70d8168a07c92b2a3ecbbb1958d85532efe3.zip |
Add coding style check, reformat.
Diffstat (limited to 'test/test_cmdline.py')
-rw-r--r-- | test/test_cmdline.py | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/test/test_cmdline.py b/test/test_cmdline.py index f7bf4612..eafcbde4 100644 --- a/test/test_cmdline.py +++ b/test/test_cmdline.py @@ -37,13 +37,24 @@ 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_special("https2http://foo.com") == [True, False, "foo.com", 80] - assert cmdline.parse_server_spec_special("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://") + 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_special( + "https2http://foo.com") == [True, False, "foo.com", 80] + assert cmdline.parse_server_spec_special( + "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(): @@ -103,7 +114,7 @@ def test_common(): ) p = tutils.test_data.path("data/replace") - opts.replace_file = [("/foo/bar/%s"%p)] + opts.replace_file = [("/foo/bar/%s" % p)] v = cmdline.get_common_options(opts)["replacements"] assert len(v) == 1 assert v[0][2].strip() == "replacecontents" @@ -122,5 +133,3 @@ def test_mitmdump(): def test_mitmweb(): ap = cmdline.mitmweb() assert ap - - |