Esempio n. 1
0
 def test_elapsed(self):
     """Test TrackerItem elapsed() functionality."""
     pi = progress.TrackerItem("testitem")
     # special case before items is set
     self.assertTrue(pi.elapsed() == 0.0)
     pi.items = 100
     time.sleep(0.20)
     # should work before done()
     self.assertTrue(pi.elapsed() >= 0.10)
     pi.done()
     # should work after done()
     self.assertTrue(pi.elapsed() >= 0.10)
Esempio n. 2
0
 def test_str(self):
     """Test str() of a TrackerItem."""
     pi = progress.TrackerItem("testitem")
     pi.items = 10
     str(pi)
Esempio n. 3
0
 def test_reset(self):
     """Test reset of a TrackerItem."""
     pi = progress.TrackerItem("testitem")
     pi.items = 10
     pi.reset()
     self.assertTrue(pi.items == 0)