• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python conftest.tasks_sample函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tests.conftest.tasks_sample函数的典型用法代码示例。如果您正苦于以下问题:Python tasks_sample函数的具体用法?Python tasks_sample怎么用?Python tasks_sample使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: testProcessRunEmptyFilter

 def testProcessRunEmptyFilter(self, depfile_name):
     output = StringIO()
     cmd_run = CmdFactory(Run, backend='dbm', dep_file=depfile_name,
                          task_list=tasks_sample(), sel_tasks=[])
     cmd_run._execute(output)
     got = output.getvalue().split("\n")[:-1]
     assert [] == got
开发者ID:JohannesBuchner,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例2: testProcessRunMThread

 def testProcessRunMThread(self, dependency1, depfile_name):
     output = StringIO()
     cmd_run = CmdFactory(Run, backend="dbm", dep_file=depfile_name, task_list=tasks_sample())
     result = cmd_run._execute(output, num_process=1, par_type="thread")
     assert 0 == result
     got = output.getvalue().split("\n")[:-1]
     assert [".  t1", ".  t2", ".  g1.a", ".  g1.b", ".  t3"] == got
开发者ID:shanbady,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例3: testFilterAll

 def testFilterAll(self):
     output = StringIO()
     cmd_list = CmdFactory(List, outstream=output, task_list=tasks_sample())
     cmd_list._execute(subtasks=True, pos_args=['g1'])
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = ['g1', 'g1.a', 'g1.b']
     assert expected == got
开发者ID:JohannesBuchner,项目名称:doit,代码行数:7,代码来源:test_cmd_list.py


示例4: testProcessRunSingle

 def testProcessRunSingle(self, depfile_name):
     output = StringIO()
     cmd_run = CmdFactory(Run, backend="dbm", dep_file=depfile_name, task_list=tasks_sample(), sel_tasks=["t3"])
     cmd_run._execute(output, single=True)
     got = output.getvalue().split("\n")[:-1]
     # t1 is a depenendency of t3 but not included
     assert [".  t3"] == got
开发者ID:shanbady,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例5: testProcessRunEmptyFilter

 def testProcessRunEmptyFilter(self, depfile):
     output = StringIO.StringIO()
     cmd_run = Run(dep_file=depfile.name, task_list=tasks_sample(),
                   sel_tasks=[])
     cmd_run._execute(output)
     got = output.getvalue().split("\n")[:-1]
     assert [] == got
开发者ID:swayf,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例6: testProcessRunMP

 def testProcessRunMP(self, dependency1, depfile):
     output = StringIO.StringIO()
     cmd_run = Run(dep_file=depfile.name, task_list=tasks_sample())
     result = cmd_run._execute(output, num_process=1)
     assert 0 == result
     got = output.getvalue().split("\n")[:-1]
     assert [".  t1", ".  t2", ".  g1.a", ".  g1.b", ".  t3"] == got
开发者ID:swayf,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例7: testCustomReporter

 def testCustomReporter(self, depfile_name):
     output = StringIO()
     cmd_run = CmdFactory(Run, backend='dbm', dep_file=depfile_name,
                          task_list=[tasks_sample()[0]])
     cmd_run._execute(output, reporter=MyReporter)
     got = output.getvalue().split("\n")[:-1]
     assert 'MyReporter.start t1' == got[0]
开发者ID:JohannesBuchner,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例8: testProcessRunFilter

 def testProcessRunFilter(self, depfile_name):
     output = StringIO()
     cmd_run = Run(backend='dbm', dep_file=depfile_name,
                   task_list=tasks_sample(), sel_tasks=["g1.a"])
     cmd_run._execute(output)
     got = output.getvalue().split("\n")[:-1]
     assert [".  g1.a"] == got
开发者ID:JeffSpies,项目名称:doit,代码行数:7,代码来源:test_cmd_run.py


示例9: testFilterSubtask

 def testFilterSubtask(self, depfile):
     output = StringIO()
     cmd_list = List(outstream=output, dep_file=depfile.name,
                     task_list=tasks_sample())
     cmd_list._execute(pos_args=['g1.a'])
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = ['g1.a']
     assert expected == got
开发者ID:JeffSpies,项目名称:doit,代码行数:8,代码来源:test_cmd_list.py


示例10: testQuiet

 def testQuiet(self):
     output = StringIO()
     tasks = tasks_sample()
     cmd_list = CmdFactory(List, outstream=output, task_list=tasks)
     cmd_list._execute()
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = [t.name for t in tasks if not t.is_subtask]
     assert sorted(expected) == got
开发者ID:JohannesBuchner,项目名称:doit,代码行数:8,代码来源:test_cmd_list.py


示例11: testMP_not_available

 def testMP_not_available(self, depfile, monkeypatch):
     # make sure MRunner wont be used
     monkeypatch.setattr(runner.MRunner, "available",
                         Mock(return_value=False))
     monkeypatch.setattr(runner.MRunner, "__init__", 'not available')
     output = StringIO.StringIO()
     cmd_run = Run(dep_file=depfile.name, task_list=tasks_sample())
     cmd_run._execute(output, num_process=3)
开发者ID:swayf,项目名称:doit,代码行数:8,代码来源:test_cmd_run.py


示例12: testSubTask

 def testSubTask(self):
     output = StringIO()
     tasks = tasks_sample()
     cmd_list = CmdFactory(List, outstream=output, task_list=tasks)
     cmd_list._execute(subtasks=True)
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = [t.name for t in sorted(tasks)]
     assert expected == got
开发者ID:JohannesBuchner,项目名称:doit,代码行数:8,代码来源:test_cmd_list.py


示例13: test_filter

 def test_filter(self, depfile, dependency1):
     output = StringIO()
     tasks = tasks_sample()
     cmd_reset = CmdFactory(ResetDep, outstream=output, task_list=tasks,
                            dep_manager=depfile)
     cmd_reset._execute(pos_args=['t2'])
     got = output.getvalue()
     assert "processed t2\n" == got
开发者ID:rbeagrie,项目名称:doit,代码行数:8,代码来源:test_cmd_resetdep.py


示例14: testCustomTemplate

 def testCustomTemplate(self):
     output = StringIO()
     tasks = tasks_sample()
     cmd_list = CmdFactory(List, outstream=output, task_list=tasks)
     cmd_list._execute(template='xxx {name} xxx {doc}')
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     assert 'xxx g1 xxx g1 doc string' == got[0]
     assert 'xxx t3 xxx t3 doc string' == got[3]
开发者ID:JohannesBuchner,项目名称:doit,代码行数:8,代码来源:test_cmd_list.py


示例15: testWithPrivate

 def testWithPrivate(self):
     task_list = list(tasks_sample())
     task_list.append(Task("_s3", [""]))
     output = StringIO()
     cmd_list = CmdFactory(List, outstream=output, task_list=task_list)
     cmd_list._execute(private=True, pos_args=['_s3'])
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = ['_s3']
     assert expected == got
开发者ID:JohannesBuchner,项目名称:doit,代码行数:9,代码来源:test_cmd_list.py


示例16: testDefault

 def testDefault(self, depfile):
     output = StringIO()
     tasks = tasks_sample()
     cmd_list = List(outstream=output, dep_file=depfile.name,
                     task_list=tasks)
     cmd_list._execute()
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = [t.name for t in tasks if not t.is_subtask]
     assert sorted(expected) == got
开发者ID:swayf,项目名称:doit,代码行数:9,代码来源:test_cmd_list.py


示例17: test_execute

 def test_execute(self, depfile, dependency1):
     output = StringIO()
     tasks = tasks_sample()
     cmd_reset = CmdFactory(ResetDep, outstream=output, task_list=tasks,
                            dep_manager=depfile)
     cmd_reset._execute()
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = ["processed %s" % t.name for t in tasks]
     assert sorted(expected) == sorted(got)
开发者ID:rbeagrie,项目名称:doit,代码行数:9,代码来源:test_cmd_resetdep.py


示例18: testSortByName

 def testSortByName(self):
     # by default, the task list should be ordered by name
     task_list = list(tasks_sample())
     output = StringIO()
     cmd_list = CmdFactory(List, outstream=output, task_list=task_list)
     cmd_list._execute()
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = ['g1', 't1', 't2', 't3']
     assert expected == got
开发者ID:pydoit,项目名称:doit,代码行数:9,代码来源:test_cmd_list.py


示例19: testSortByDefinition

 def testSortByDefinition(self):
     # test sorting task list by order of definition
     task_list = list(tasks_sample())
     output = StringIO()
     cmd_list = CmdFactory(List, outstream=output, task_list=task_list)
     cmd_list._execute(sort='definition')
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     expected = ['t1', 't2', 'g1', 't3']
     assert expected == got
开发者ID:pydoit,项目名称:doit,代码行数:9,代码来源:test_cmd_list.py


示例20: testCustomReporter

 def testCustomReporter(self, depfile):
     output = StringIO.StringIO()
     class MyReporter(reporter.ConsoleReporter):
         def get_status(self, task):
             self.outstream.write('MyReporter.start %s\n' % task.name)
     cmd_run = Run(dep_file=depfile.name, task_list=[tasks_sample()[0]])
     cmd_run._execute(output, reporter=MyReporter)
     got = output.getvalue().split("\n")[:-1]
     assert 'MyReporter.start t1' == got[0]
开发者ID:swayf,项目名称:doit,代码行数:9,代码来源:test_cmd_run.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python conftest.CmdFactory类代码示例发布时间:2022-05-27
下一篇:
Python conftest.make_workdir函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap