Beispiel #1
0
 def test_long_elapsed_time_increases(self):
     with sleep.mocked():
         last_elapsed = None
         for elapsed in Timeout.long():
             if last_elapsed is not None:
                 self.assertThat(elapsed, GreaterThan(last_elapsed))
             else:
                 self.assertEqual(elapsed, 0.0)
             last_elapsed = elapsed
Beispiel #2
0
 def test_long_timeout_final_call(self):
     set_long_timeout_period(0.0)
     self.assertThat(len(list(Timeout.long())), Equals(1))
Beispiel #3
0
 def test_long_sleeps_for_correct_time(self):
     with sleep.mocked() as mocked_sleep:
         for _ in Timeout.long():
             pass
         self.assertEqual(30.0, mocked_sleep.total_time_slept())