def test_with(self): diff_time = 0.5 with marktime.Marker() as m: time.sleep(diff_time) self.assertEquals( round(m.duration().seconds, 2), round(diff_time, 2))
def test_sleep(self): diff_time = 0.5 marker = marktime.Marker() self.assertEquals( round(marker.start().sleep(diff_time).stop().duration().sec, 2), round(diff_time, 2))
def test_is_stopped(self): marker = marktime.Marker() self.assertFalse(marker.is_stopped()) self.assertFalse(marker.start().is_stopped()) self.assertTrue(marker.stop().is_stopped())
def test_continue(self): marker = marktime.Marker().start().stop().coninue() self.assertTrue(marker.is_running())