@@ -33,7 +33,7 @@ def test_contains():
3333
3434def test_max ():
3535 histo = histogram .Histogram ()
36- assert histo .max == 600
36+ assert histo .max == histogram . MAX_ACK_DEADLINE
3737 histo .add (120 )
3838 assert histo .max == 120
3939 histo .add (150 )
@@ -44,7 +44,7 @@ def test_max():
4444
4545def test_min ():
4646 histo = histogram .Histogram ()
47- assert histo .min == 10
47+ assert histo .min == histogram . MIN_ACK_DEADLINE
4848 histo .add (60 )
4949 assert histo .min == 60
5050 histo .add (30 )
@@ -63,20 +63,23 @@ def test_add():
6363
6464def test_add_lower_limit ():
6565 histo = histogram .Histogram ()
66- histo .add (5 )
67- assert 5 not in histo
68- assert 10 in histo
66+ low_value = histogram .MIN_ACK_DEADLINE - 1
67+ histo .add (low_value )
68+ assert low_value not in histo
69+ assert histogram .MIN_ACK_DEADLINE in histo
6970
7071
7172def test_add_upper_limit ():
7273 histo = histogram .Histogram ()
73- histo .add (12000 )
74- assert 12000 not in histo
75- assert 600 in histo
74+ high_value = histogram .MAX_ACK_DEADLINE + 1
75+ histo .add (high_value )
76+ assert high_value not in histo
77+ assert histogram .MAX_ACK_DEADLINE in histo
7678
7779
7880def test_percentile ():
7981 histo = histogram .Histogram ()
82+ assert histo .percentile (42 ) == histogram .MIN_ACK_DEADLINE # default when empty
8083 [histo .add (i ) for i in range (101 , 201 )]
8184 assert histo .percentile (100 ) == 200
8285 assert histo .percentile (101 ) == 200
0 commit comments