本文整理汇总了Python中accessories.TestTerminal.move方法的典型用法代码示例。如果您正苦于以下问题:Python TestTerminal.move方法的具体用法?Python TestTerminal.move怎么用?Python TestTerminal.move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类accessories.TestTerminal
的用法示例。
在下文中一共展示了TestTerminal.move方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: child_mnemonics_willmove
# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import move [as 别名]
def child_mnemonics_willmove(kind):
from blessed.sequences import measure_length
t = TestTerminal(kind=kind)
# movements
assert (len(t.move(98, 76)) ==
measure_length(t.move(98, 76), t))
assert (len(t.move(54)) ==
measure_length(t.move(54), t))
assert not t.cud1 or (len(t.cud1) ==
measure_length(t.cud1, t))
assert not t.cub1 or (len(t.cub1) ==
measure_length(t.cub1, t))
assert not t.cuf1 or (len(t.cuf1) ==
measure_length(t.cuf1, t))
assert not t.cuu1 or (len(t.cuu1) ==
measure_length(t.cuu1, t))
assert not t.cub or (len(t.cub(333)) ==
measure_length(t.cub(333), t))
assert not t.cuf or (len(t.cuf(333)) ==
measure_length(t.cuf(333), t))
assert not t.home or (len(t.home) ==
measure_length(t.home, t))
assert not t.restore or (len(t.restore) ==
measure_length(t.restore, t))
assert not t.clear or (len(t.clear) ==
measure_length(t.clear, t))
示例2: child
# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import move [as 别名]
def child(kind):
buf = StringIO()
t = TestTerminal(stream=buf, force_styling=True)
y, x = 10, 20
with t.location(y, x):
xy_val = t.move(x, y)
yx_val = buf.getvalue()[len(t.sc) :]
assert xy_val == yx_val
示例3: child
# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import move [as 别名]
def child(kind):
t = TestTerminal(stream=StringIO(), kind=kind)
assert (t.clear == '')
assert (t.move(1 == 2) == '')
assert (t.move_x(1) == '')
assert (t.bold() == '')
assert (t.bold('', 'x', 'huh?') == '')
assert (t.bold('', 9876) == '')
assert (t.uhh(9876) == '')
assert (t.clear('x') == 'x')