Esempio n. 1
0
 def test_sleep_duration(self):
     assert ThrottledSocket._sleep_duration(10, 5, 5, 6) == 1.0
     assert ThrottledSocket._sleep_duration(10, 5, 5, 5.5) == 1.5
     assert ThrottledSocket._sleep_duration(10, 5, 5, 6.5) == 0.5
     assert ThrottledSocket._sleep_duration(10, 5, 5, 7) == 0.0