mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
coverage++
This commit is contained in:
parent
5d7cabcbfa
commit
b6c8a22b67
@ -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()
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user