def main(): print('generating random sentences...') count = 15 docgen = DocumentGenerator() terminal = Terminal(count) terminal.write_lines() terminal.hide_cursor() for _ in range(800): index = random.randint(0, count - 1) terminal.write_line(index, docgen.sentence()) time.sleep(.01) terminal.write_lines(force=True) terminal.show_cursor()
def test__show_cursor_Should_CallExpected_When_NoAtty(self, cursor_patch, stderr_patch, *patches): stderr_patch.isatty.return_value = False term = Terminal(3, create=False) term.show_cursor() cursor_patch.show.assert_not_called()