diff options
| author | Maximilian Hils <git@maximilianhils.com> | 2014-09-06 12:23:05 +0200 |
|---|---|---|
| committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-06 12:23:05 +0200 |
| commit | b6c8a22b675cea20ceb0b2b066e955733ca9cc95 (patch) | |
| tree | 5f146356b1474f4ab1ac8f179de0f1230a3f0e9d | |
| parent | 5d7cabcbfa0fda53b92c9e9449dae4812cf5abef (diff) | |
| download | mitmproxy-b6c8a22b675cea20ceb0b2b066e955733ca9cc95.tar.gz mitmproxy-b6c8a22b675cea20ceb0b2b066e955733ca9cc95.tar.bz2 mitmproxy-b6c8a22b675cea20ceb0b2b066e955733ca9cc95.zip | |
coverage++
| -rw-r--r-- | libmproxy/cmdline.py | 3 | ||||
| -rw-r--r-- | test/test_proxy.py | 20 |
2 files changed, 17 insertions, 6 deletions
diff --git a/libmproxy/cmdline.py b/libmproxy/cmdline.py index b9e62b71..28156a59 100644 --- a/libmproxy/cmdline.py +++ b/libmproxy/cmdline.py @@ -421,8 +421,7 @@ def common_options(parser): "Proxy Authentication", """ Specify which users are allowed to access the proxy and the method - used for authenticating them. These options are ignored if the - proxy is in transparent or reverse proxy mode. + used for authenticating them. """ ) user_specification_group = group.add_mutually_exclusive_group() diff --git a/test/test_proxy.py b/test/test_proxy.py index 2ff01acc..614bb8b9 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -69,12 +69,24 @@ class TestProcessProxyOptions: def test_no_transparent(self): self.assert_err("transparent mode not supported", "-T") + @mock.patch("libmproxy.platform.resolver") - def test_transparent_reverse(self, _): - self.assert_err("mutually exclusive", "-R", "http://localhost", "-T") - self.assert_noerr("-T") - self.assert_err("Invalid server specification", "-R", "reverse") + def test_modes(self, _): self.assert_noerr("-R", "http://localhost") + self.assert_err("expected one argument", "-R") + self.assert_err("Invalid server specification", "-R", "reverse") + + self.assert_noerr("-T") + + self.assert_noerr("-U", "http://localhost") + self.assert_err("expected one argument", "-U") + self.assert_err("Invalid server specification", "-U", "upstream") + + self.assert_noerr("--destination-server", "http://localhost") + self.assert_err("expected one argument", "--destination-server") + self.assert_err("Invalid server specification", "--destination-server", "manual") + + self.assert_err("mutually exclusive", "-R", "http://localhost", "-T") def test_client_certs(self): with tutils.tmpdir() as confdir: |
