diff options
author | Marcelo Glezer <mg@tekii.com.ar> | 2015-02-26 18:14:20 -0300 |
---|---|---|
committer | Marcelo Glezer <mg@tekii.com.ar> | 2015-02-26 18:14:20 -0300 |
commit | 3a78c95d0a202b486d062951ee0593f43a16eac2 (patch) | |
tree | 818856dd662ec8bdb429342810fd884c3463c37b /test | |
parent | bd6c3f64c1f3102a4e91d4a964757821773781e0 (diff) | |
download | mitmproxy-3a78c95d0a202b486d062951ee0593f43a16eac2.tar.gz mitmproxy-3a78c95d0a202b486d062951ee0593f43a16eac2.tar.bz2 mitmproxy-3a78c95d0a202b486d062951ee0593f43a16eac2.zip |
added to flowlist / flowdetail time elapsed between request sent and response received
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index d99a146d..45bfb4f7 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -50,6 +50,19 @@ def test_urldecode(): s = "one=two&three=four" assert len(utils.urldecode(s)) == 2 +def test_pretty_duration(): + assert utils.pretty_duration(0.00001) == "0ms" + assert utils.pretty_duration(0.0001) == "0ms" + assert utils.pretty_duration(0.001) == "1ms" + assert utils.pretty_duration(0.01) == "10ms" + assert utils.pretty_duration(0.1) == "100ms" + assert utils.pretty_duration(1) == "1.00s" + assert utils.pretty_duration(10) == "10.0s" + assert utils.pretty_duration(100) == "100s" + assert utils.pretty_duration(1000) == "1000s" + assert utils.pretty_duration(10000) == "10000s" + assert utils.pretty_duration(1.123) == "1.12s" + assert utils.pretty_duration(0.123) == "123ms" def test_LRUCache(): class Foo: |