diff options
author | Matthew Shao <me@matshao.com> | 2018-01-08 21:51:03 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2018-01-08 21:51:03 +0800 |
commit | a6f6f8cd3226de3c89ec9d6cdeab972c88b94a18 (patch) | |
tree | 03cbac2b88606b348717a87a2cfc703672cac8c4 /test | |
parent | 633bc350d225eb02c7ab0aef6bae57c4def560e1 (diff) | |
download | mitmproxy-a6f6f8cd3226de3c89ec9d6cdeab972c88b94a18.tar.gz mitmproxy-a6f6f8cd3226de3c89ec9d6cdeab972c88b94a18.tar.bz2 mitmproxy-a6f6f8cd3226de3c89ec9d6cdeab972c88b94a18.zip |
Raise a CommandError for the exception
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/addons/test_view.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/mitmproxy/addons/test_view.py b/test/mitmproxy/addons/test_view.py index 72f1a0fb..a95d059d 100644 --- a/test/mitmproxy/addons/test_view.py +++ b/test/mitmproxy/addons/test_view.py @@ -147,9 +147,10 @@ def test_create(): assert v[0].request.url == "http://foo.com/" v.create("get", "http://foo.com") assert len(v) == 2 - v.create("get", "http://foo.com\\") - v.create("get", "http://") - assert len(v) == 2 + with pytest.raises(exceptions.CommandError, match="Invalid URL"): + v.create("get", "http://foo.com\\") + with pytest.raises(exceptions.CommandError, match="Invalid URL"): + v.create("get", "http://") def test_orders(): |