Esempio n. 1
0
 def test_duration(self):
     interval = Interval()
     interval.start()
     first = interval.duration
     time.sleep(0.1)
     second = interval.duration
     self.assertTrue(second > first)
Esempio n. 2
0
 def test_running(self):
     interval = Interval()
     self.assertFalse(interval.running)
     interval.start()
     self.assertTrue(interval.running)
     interval.stop()
     self.assertFalse(interval.running)
Esempio n. 3
0
 def test_running(self):
     interval = Interval()
     self.assertFalse(interval.running)
     interval.start()
     self.assertTrue(interval.running)
     interval.stop()
     self.assertFalse(interval.running)
Esempio n. 4
0
 def test_started(self):
     interval = Interval()
     self.assertFalse(interval.started)
     interval.start()
     self.assertTrue(interval.started)
Esempio n. 5
0
 def test_split(self):
     interval = Interval()
     interval.start()
     splitted_interval = interval.split()
     self.assertEquals(interval.stop_instant,
                       splitted_interval.start_instant)
Esempio n. 6
0
 def test_now(self):
     interval = Interval.now()
     self.assertTrue(interval.started)
     self.assertFalse(interval.stopped)
Esempio n. 7
0
 def test_duration(self):
     interval = Interval()
     interval.start()
     first = interval.duration
     second = interval.duration
     self.assertTrue(second > first)
Esempio n. 8
0
 def test_started(self):
     interval = Interval()
     self.assertFalse(interval.started)
     interval.start()
     self.assertTrue(interval.started)
Esempio n. 9
0
 def test_split(self):
     interval = Interval()
     interval.start()
     splitted_interval = interval.split()
     self.assertEquals(interval.stop_instant, splitted_interval.start_instant)
Esempio n. 10
0
 def test_now(self):
     interval = Interval.now()
     self.assertTrue(interval.started)
     self.assertFalse(interval.stopped)