Пример #1
0
 def child(kind):
     t = TestTerminal(kind=kind, stream=StringIO(), force_styling=True)
     with t.location(0, 0):
         pass
     expected_output = u''.join(
         (unicode_cap('sc'), unicode_parm('cup', 0, 0), unicode_cap('rc')))
     assert (t.stream.getvalue() == expected_output)
Пример #2
0
 def child_with_styling(kind):
     t = TestTerminal(kind=kind, stream=StringIO(), force_styling=True)
     with t.location(3, 4):
         t.stream.write(u'hi')
     expected_output = u''.join(
         (unicode_cap('sc'), unicode_parm('cup', 4,
                                          3), u'hi', unicode_cap('rc')))
     assert (t.stream.getvalue() == expected_output)
Пример #3
0
 def child(kind):
     t = TestTerminal(kind=kind, stream=StringIO(), force_styling=True)
     with t.location(0, 0):
         pass
     expected_output = u''.join(
         (unicode_cap('sc'),
          unicode_parm('cup', 0, 0),
          unicode_cap('rc')))
     assert (t.stream.getvalue() == expected_output)
Пример #4
0
 def child_with_styling(kind):
     t = TestTerminal(kind=kind, stream=StringIO(), force_styling=True)
     with t.location(3, 4):
         t.stream.write(u'hi')
     expected_output = u''.join(
         (unicode_cap('sc'),
          unicode_parm('cup', 4, 3),
          u'hi', unicode_cap('rc')))
     assert (t.stream.getvalue() == expected_output)
Пример #5
0
 def child():
     assert TestTerminal().cup(3, 4) == unicode_parm('cup', 3, 4)
Пример #6
0
 def on_color(t, num):
     return t.number_of_colors and unicode_parm('setab', num) or ''
Пример #7
0
 def child():
     assert TestTerminal().cup(3, 4) == unicode_parm('cup', 3, 4)
Пример #8
0
 def on_color(t, num):
     return t.number_of_colors and unicode_parm('setab', num) or ''