コード例 #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(kind):
     t = TestTerminal(kind=kind, stream=StringIO(), force_styling=True)
     ROW = 5
     with t.location(y=ROW):
         pass
     expected_output = u''.join(
         (unicode_cap('sc'), u'\x1b[{0}d'.format(ROW + 1),
          unicode_cap('rc')))
     assert (t.stream.getvalue() == expected_output)
コード例 #6
0
 def child(kind):
     t = TestTerminal(kind=kind, stream=StringIO(), force_styling=True)
     ROW = 5
     with t.location(y=ROW):
         pass
     expected_output = u''.join(
         (unicode_cap('sc'),
          u'\x1b[{0}d'.format(ROW + 1),
          unicode_cap('rc')))
     assert (t.stream.getvalue() == expected_output)
コード例 #7
0
 def child():
     # Also test that Terminal grabs a reasonable default stream. This test
     # assumes it will be run from a tty.
     t = TestTerminal()
     sc = unicode_cap('sc')
     assert t.save == sc
     assert t.save == sc  # Make sure caching doesn't screw it up.
コード例 #8
0
 def child():
     # Also test that Terminal grabs a reasonable default stream. This test
     # assumes it will be run from a tty.
     t = TestTerminal()
     sc = unicode_cap('sc')
     assert t.save == sc
     assert t.save == sc  # Make sure caching doesn't screw it up.
コード例 #9
0
 def child():
     t = TestTerminal(stream=StringIO(), force_styling=True)
     assert t.save == unicode_cap('sc')
コード例 #10
0
 def child():
     t = TestTerminal(stream=StringIO(), force_styling=True)
     assert t.save == unicode_cap('sc')
コード例 #11
0
ファイル: test_core.py プロジェクト: AliMehrpour/qark
 def child(kind):
     t = TestTerminal(stream=StringIO(), force_styling=True)
     with t.location():
         pass
     expected_output = u"".join((unicode_cap("sc"), unicode_cap("rc")))
     assert t.stream.getvalue() == expected_output