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


Python CmdFactory._execute方法代码示例

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


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

示例1: testFilterAll

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:9,代码来源:test_cmd_list.py

示例2: test_no_children

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 def test_no_children(self):
     my_task = Task("t2", [""], file_dep=['d2.txt'])
     output = StringIO()
     cmd = CmdFactory(Graphx, outstream=output, task_list=[my_task])
     cmd._execute(graph_type='json', no_children=True)
     got = output.getvalue()
     self.assertNotIn("d2.txt", got)
开发者ID:ee08b397,项目名称:doit-graphx,代码行数:9,代码来源:test_cmd_graphx.py

示例3: testCustomReporter

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:9,代码来源:test_cmd_run.py

示例4: testProcessRunEmptyFilter

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:9,代码来源:test_cmd_run.py

示例5: testProcessRunSingle

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:9,代码来源:test_cmd_run.py

示例6: testDependencies

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 def testDependencies(self):
     my_task = Task("t2", [""], file_dep=['d2.txt'])
     output = StringIO()
     cmd_list = CmdFactory(List, outstream=output, task_list=[my_task])
     cmd_list._execute(list_deps=True)
     got = output.getvalue()
     assert "d2.txt" in got
开发者ID:JohannesBuchner,项目名称:doit,代码行数:9,代码来源:test_cmd_list.py

示例7: testSubTask

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:10,代码来源:test_cmd_list.py

示例8: testCustomTemplate

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:10,代码来源:test_cmd_list.py

示例9: test_store_json_stdout

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 def test_store_json_stdout(self):
     output = StringIO()
     cmd = CmdFactory(Graphx, outstream=output, task_list=_sample_tasks())
     cmd._execute(graph_type='json')
     got = output.getvalue()
     self.assertIn("read", got)
     self.assertIn("t3", got)
     self.assertIn("join_files", got)
开发者ID:ee08b397,项目名称:doit-graphx,代码行数:10,代码来源:test_cmd_graphx.py

示例10: testQuiet

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:10,代码来源:test_cmd_list.py

示例11: test_unicode_name

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 def test_unicode_name(self, depfile):
     task_list = [Task(six.u("t做"), [""], doc=six.u("t1 doc string 做")),]
     output = StringIO()
     cmd_list = CmdFactory(List, outstream=output, dep_file=depfile.name,
                           task_list=task_list)
     cmd_list._execute()
     got = [line.strip() for line in output.getvalue().split('\n') if line]
     assert six.u('t做') == got[0]
开发者ID:JohannesBuchner,项目名称:doit,代码行数:10,代码来源:test_cmd_list.py

示例12: test_children

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 def test_children(self):
     # TODO: Implement no-child option.
     my_task = Task("t2", [""], file_dep=['d2.txt'])
     output = StringIO()
     cmd = CmdFactory(Graphx, outstream=output, task_list=[my_task])
     cmd._execute(graph_type='json', no_children=False)
     got = output.getvalue()
     self.assertIn("d2.txt", got)
开发者ID:ee08b397,项目名称:doit-graphx,代码行数:10,代码来源:test_cmd_graphx.py

示例13: test_filter

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:10,代码来源:test_cmd_resetdep.py

示例14: testWithPrivate

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:11,代码来源:test_cmd_list.py

示例15: testSortByName

# 需要导入模块: from tests.conftest import CmdFactory [as 别名]
# 或者: from tests.conftest.CmdFactory import _execute [as 别名]
 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,代码行数:11,代码来源:test_cmd_list.py


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