当前位置: 首页>>代码示例>>Python>>正文


Python TestTerminal.location方法代码示例

本文整理汇总了Python中accessories.TestTerminal.location方法的典型用法代码示例。如果您正苦于以下问题:Python TestTerminal.location方法的具体用法?Python TestTerminal.location怎么用?Python TestTerminal.location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在accessories.TestTerminal的用法示例。


在下文中一共展示了TestTerminal.location方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: child_without_styling

# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import location [as 别名]
    def child_without_styling():
        """No side effect for location as a context manager without styling."""
        t = TestTerminal(stream=StringIO(), force_styling=None)

        with t.location(3, 4):
            t.stream.write(u'hi')

        assert t.stream.getvalue() == u'hi'
开发者ID:0x37N0w4N,项目名称:MARA_Framework,代码行数:10,代码来源:test_sequences.py

示例2: child

# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import location [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
开发者ID:AliMehrpour,项目名称:qark,代码行数:10,代码来源:test_core.py

示例3: child

# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import location [as 别名]
 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)
开发者ID:0x37N0w4N,项目名称:MARA_Framework,代码行数:11,代码来源:test_sequences.py

示例4: child_with_styling

# 需要导入模块: from accessories import TestTerminal [as 别名]
# 或者: from accessories.TestTerminal import location [as 别名]
 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)
开发者ID:0x37N0w4N,项目名称:MARA_Framework,代码行数:11,代码来源:test_sequences.py


注:本文中的accessories.TestTerminal.location方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。