aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPierre Gordon <pierregordon@protonmail.com>2019-04-19 13:10:39 -0500
committerPierre Gordon <pierregordon@protonmail.com>2019-04-19 13:10:39 -0500
commit1b3f86e70938d43b5d1f702ef6ca18ecfa32c636 (patch)
tree47041d3a8414e2127bab337268b3154e4a561a4a /test
parent8d0c800d15039ff0a880051f4271acf668904e12 (diff)
downloadmitmproxy-1b3f86e70938d43b5d1f702ef6ca18ecfa32c636.tar.gz
mitmproxy-1b3f86e70938d43b5d1f702ef6ca18ecfa32c636.tar.bz2
mitmproxy-1b3f86e70938d43b5d1f702ef6ca18ecfa32c636.zip
Verify ignore_hosts & allow_hosts are mutually exclusive
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/proxy/test_config.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mitmproxy/proxy/test_config.py b/test/mitmproxy/proxy/test_config.py
index 1da031c6..1319d1a9 100644
--- a/test/mitmproxy/proxy/test_config.py
+++ b/test/mitmproxy/proxy/test_config.py
@@ -17,3 +17,12 @@ class TestProxyConfig:
opts.certs = [tdata.path("mitmproxy/data/dumpfile-011")]
with pytest.raises(exceptions.OptionsError, match="Invalid certificate format"):
ProxyConfig(opts)
+
+ def test_cannot_set_both_allow_and_filter_options(self):
+ opts = options.Options()
+ opts.ignore_hosts = ["foo"]
+ opts.allow_hosts = ["bar"]
+ with pytest.raises(exceptions.OptionsError, match="--ignore-hosts and --allow-hosts are "
+ "mutually exclusive; please choose "
+ "one."):
+ ProxyConfig(opts)