示例#1
0
 def test_refresh_l_size(self):
     pgb_stream = StringIO()
     expected_stream = StringIO()
     pgb = ProgressBar(20, 3, stream=pgb_stream)
     pgb.refresh()
     expected_stream.write("\r["+' '*3+"]")
     self.assertEqual(pgb_stream.getvalue(), expected_stream.getvalue())
示例#2
0
 def test_refresh(self):
     pgb_stream = StringIO()
     expected_stream = StringIO()
     pgb = ProgressBar(20, stream=pgb_stream)
     self.assertEqual(pgb_stream.getvalue(), expected_stream.getvalue()) # nothing print before refresh
     pgb.refresh()
     expected_stream.write("\r["+' '*20+"]")
     self.assertEqual(pgb_stream.getvalue(), expected_stream.getvalue())