aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorUjjwal Verma <ujjwalverma1111@gmail.com>2017-04-09 18:55:20 +0530
committerUjjwal Verma <ujjwalverma1111@gmail.com>2017-04-09 18:55:20 +0530
commit742127ef7bcde86bdde911a8399a05c4c4d75d5b (patch)
treef74088499d45c3ccf32a58cb5da0a26330acf1fe /test
parentc7b501275205e2cf82055981106336d4a0db252f (diff)
downloadmitmproxy-742127ef7bcde86bdde911a8399a05c4c4d75d5b.tar.gz
mitmproxy-742127ef7bcde86bdde911a8399a05c4c4d75d5b.tar.bz2
mitmproxy-742127ef7bcde86bdde911a8399a05c4c4d75d5b.zip
Fixes #2109
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/utils/test_human.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/mitmproxy/utils/test_human.py b/test/mitmproxy/utils/test_human.py
index 3d65dfd1..76dc2f88 100644
--- a/test/mitmproxy/utils/test_human.py
+++ b/test/mitmproxy/utils/test_human.py
@@ -46,3 +46,10 @@ def test_pretty_duration():
assert human.pretty_duration(10000) == "10000s"
assert human.pretty_duration(1.123) == "1.12s"
assert human.pretty_duration(0.123) == "123ms"
+
+
+def test_format_address():
+ assert human.format_address(("::1", "54010", "0", "0")) == "[::1]:54010"
+ assert human.format_address(("::ffff:127.0.0.1", "54010", "0", "0")) == "127.0.0.1:54010"
+ assert human.format_address(("127.0.0.1", "54010")) == "127.0.0.1:54010"
+ assert human.format_address(("example.com", "54010")) == "example.com:54010"