Example #1
0
 def test_overwrite(self):
     pr = Printer(self.print_, True)
     pr.update('hello world')
     pr.update('goodbye world')
     pr.flush()
     self.assertEqual(self.out,
                      ['hello world',
                       '\r           \r',
                       'goodbye world',
                       '\n'])
Example #2
0
 def test_elide(self):
     pr = Printer(self.print_, False, cols=8)
     pr.update('hello world')
     pr.flush()
     self.assertEqual(self.out, ['hel ...', '\n'])
Example #3
0
 def test_basic(self):
     pr = Printer(self.print_, False)
     pr.update('foo')
     pr.flush()
     self.assertEqual(self.out, ['foo', '\n'])