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


Python UI.proc_outputs方法代码示例

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


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

示例1: test_list_tests_requests_concurrency_instances

# 需要导入模块: from testrepository.ui.model import UI [as 别名]
# 或者: from testrepository.ui.model.UI import proc_outputs [as 别名]
 def test_list_tests_requests_concurrency_instances(self):
     # testr list-tests is non-parallel, so needs 1 instance.
     # testr run triggering list-tests will want to run parallel on all, so
     # avoid latency by asking for whatever concurrency is up front.
     # This covers the case for non-listing runs as well, as the code path
     # is common.
     self.dirty()
     ui = UI(options= [('concurrency', 2), ('parallel', True)])
     ui.here = self.tempdir
     cmd = run.run(ui)
     ui.set_command(cmd)
     ui.proc_outputs = [_b('returned\ninstances\n')]
     command = self.useFixture(TestCommand(ui, None))
     self.set_config(
         '[DEFAULT]\ntest_command=foo $LISTOPT $IDLIST\ntest_id_list_default=whoo yea\n'
         'test_list_option=--list\n'
         'instance_provision=provision -c $INSTANCE_COUNT\n'
         'instance_execute=quux $INSTANCE_ID -- $COMMAND\n')
     fixture = self.useFixture(command.get_run_command(test_ids=['1']))
     fixture.list_tests()
     self.assertEqual(set([_b('returned'), _b('instances')]), command._instances)
     self.assertEqual(set([]), command._allocated_instances)
     self.assertThat(ui.outputs, MatchesAny(Equals([
         ('values', [('running', 'provision -c 2')]),
         ('popen', ('provision -c 2',), {'shell': True, 'stdout': -1}),
         ('communicate',),
         ('values', [('running', 'quux instances -- foo --list whoo yea')]),
         ('popen',('quux instances -- foo --list whoo yea',),
          {'shell': True, 'stdin': -1, 'stdout': -1}),
         ('communicate',)]), Equals([
         ('values', [('running', 'provision -c 2')]),
         ('popen', ('provision -c 2',), {'shell': True, 'stdout': -1}),
         ('communicate',),
         ('values', [('running', 'quux returned -- foo --list whoo yea')]),
         ('popen',('quux returned -- foo --list whoo yea',),
          {'shell': True, 'stdin': -1, 'stdout': -1}),
         ('communicate',)])))
开发者ID:testing-cabal,项目名称:testrepository,代码行数:39,代码来源:test_testcommand.py


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