From 742127ef7bcde86bdde911a8399a05c4c4d75d5b Mon Sep 17 00:00:00 2001 From: Ujjwal Verma Date: Sun, 9 Apr 2017 18:55:20 +0530 Subject: Fixes #2109 --- test/mitmproxy/utils/test_human.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') 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" -- cgit v1.2.3