Esempio n. 1
0
 def test_print_bar(self):
     pb = ProgressBar(total_len=5, width=5, fill_char="#", message="Test")
     pb.increment()  # increments progress bar by 1
     self.assertIsNone(pb.print_bar())
Esempio n. 2
0
 def test_format_bar(self):
     pb = ProgressBar(total_len=5, width=5, fill_char="#", message="Test")
     pb.increment()  # increments progress bar by 1
     self.assertEqual("Test\t\t|#----|  20 %", pb.format_bar())
Esempio n. 3
0
 def test_increment(self):
     pb = ProgressBar()
     pb.increment(10)
     self.assertEqual(10, pb.present_level)
     pb.increment(20)
     self.assertEqual(pb.present_level, pb.total_len)
Esempio n. 4
0
 def test_print_bar(self):
     pb = ProgressBar(total_len=5, width=5, fill_char="#", message="Test")
     pb.increment()  # increments progress bar by 1
     self.assertIsNone(pb.print_bar())
Esempio n. 5
0
 def test_format_bar(self):
     pb = ProgressBar(total_len=5, width=5, fill_char="#", message="Test")
     pb.increment()  # increments progress bar by 1
     self.assertEqual(u"Test\t\t|#----|  20 %", pb.format_bar())
Esempio n. 6
0
 def test_increment(self):
     pb = ProgressBar()
     pb.increment(10)
     self.assertEqual(10, pb.present_level)
     pb.increment(20)
     self.assertEqual(pb.present_level, pb.total_len)