aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authoryonder <kzxiao.hy@gmail.com>2016-03-04 11:12:03 -0500
committeryonder <kzxiao.hy@gmail.com>2016-03-04 11:12:03 -0500
commit0e27dfd9c132e1f8768ae33a33ae8a1c55541948 (patch)
treeeb39a3224d6dffbbcb0550ff3ca16c4c72e288c2 /test
parentb8ae666c78aef9a6ef0e67179d38980247d0e1a5 (diff)
downloadmitmproxy-0e27dfd9c132e1f8768ae33a33ae8a1c55541948.tar.gz
mitmproxy-0e27dfd9c132e1f8768ae33a33ae8a1c55541948.tar.bz2
mitmproxy-0e27dfd9c132e1f8768ae33a33ae8a1c55541948.zip
Improve test case
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_cmdline.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/mitmproxy/test_cmdline.py b/test/mitmproxy/test_cmdline.py
index 1546bb41..e75b7baf 100644
--- a/test/mitmproxy/test_cmdline.py
+++ b/test/mitmproxy/test_cmdline.py
@@ -56,8 +56,12 @@ def test_parse_server_spec():
def test_parse_upstream_auth():
tutils.raises("Invalid upstream auth specification", cmdline.parse_upstream_auth, "")
+ tutils.raises("Invalid upstream auth specification", cmdline.parse_upstream_auth, ":")
+ tutils.raises("Invalid upstream auth specification", cmdline.parse_upstream_auth, ":test")
assert cmdline.parse_upstream_auth(
"test:test") == "Basic" + " " + base64.b64encode("test:test")
+ assert cmdline.parse_upstream_auth(
+ "test:") == "Basic" + " " + base64.b64encode("test:")
def test_parse_setheaders():