Ejemplo n.º 1
0
 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))
Ejemplo n.º 2
0
    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))
Ejemplo n.º 3
0
    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())
Ejemplo n.º 4
0
 def test_continue(self):
     marker = marktime.Marker().start().stop().coninue()
     self.assertTrue(marker.is_running())