コード例 #1
0
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()
コード例 #2
0
ファイル: test_terminal.py プロジェクト: soda480/mp4ansi
 def test__write_lines_Should_CallExpected_When_AddDuration(self, write_patch, *patches):
     trmnl = Terminal(3, durations={'0': 'd1', '1': 'd2', '2': 'd3'})
     trmnl.current = 0
     trmnl.write_lines(add_duration=True)
     self.assertEqual(len(write_patch.mock_calls), 3)
コード例 #3
0
ファイル: test_terminal.py プロジェクト: soda480/mp4ansi
 def test__write_lines_Should_CallExpected_When_Called(self, write_patch, *patches):
     term = Terminal(3)
     term.write_lines()
     self.assertEqual(len(write_patch.mock_calls), 3)