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


Python Task.dep_changed方法代码示例

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


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

示例1: test_meta_arg_default_disallowed

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
 def test_meta_arg_default_disallowed(self):
     def py_callable(a, b, changed=None): pass
     task = Task('Fake', [(py_callable, ('a', 'b'))])
     task.options = {}
     task.dep_changed = ['changed']
     my_action = task.actions[0]
     pytest.raises(action.InvalidTask, my_action.execute)
开发者ID:pydoit,项目名称:doit,代码行数:9,代码来源:test_action.py

示例2: test_extra_kwarg_overwritten

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
 def test_extra_kwarg_overwritten(self):
     got = []
     def py_callable(a, b, **kwargs):
         got.append(a)
         got.append(b)
         got.append(kwargs['changed'])
     task = Task('Fake', [(py_callable, ('a', 'b'), {'changed': 'c'})])
     task.options = {}
     task.dep_changed = ['changed']
     my_action = task.actions[0]
     my_action.execute()
     assert got == ['a', 'b', 'c']
开发者ID:pydoit,项目名称:doit,代码行数:14,代码来源:test_action.py

示例3: test_extra_arg_overwritten

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
 def test_extra_arg_overwritten(self):
     got = []
     def py_callable(a, b, changed):
         got.append(a)
         got.append(b)
         got.append(changed)
     task = Task('Fake', [(py_callable, ('a', 'b', 'c'))])
     task.dep_changed = ['changed']
     task.options = {}
     my_action = task.actions[0]
     my_action.execute()
     assert got == ['a', 'b', 'c']
开发者ID:pydoit,项目名称:doit,代码行数:14,代码来源:test_action.py

示例4: test_mixed_args

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
 def test_mixed_args(self):
     got = []
     def py_callable(a, b, changed):
         got.append(a)
         got.append(b)
         got.append(changed)
     task = Task('Fake', [(py_callable, ('a', 'b'))])
     task.options = {}
     task.dep_changed = ['changed']
     my_action = task.actions[0]
     my_action.execute()
     assert got == ['a', 'b', ['changed']]
开发者ID:pydoit,项目名称:doit,代码行数:14,代码来源:test_action.py

示例5: test_method

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
 def test_method(self):
     got = []
     class CallMe(object):
         def xxx(self, a, b, changed):
             got.append(a)
             got.append(b)
             got.append(changed)
     task = Task('Fake', [(CallMe().xxx, ('a', 'b'))])
     task.options = {}
     task.dep_changed = ['changed']
     my_action = task.actions[0]
     my_action.execute()
     assert got == ['a', 'b', ['changed']]
开发者ID:pydoit,项目名称:doit,代码行数:15,代码来源:test_action.py

示例6: test_named_extra_args

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
 def test_named_extra_args(self):
     got = []
     def py_callable(targets, dependencies, changed, task):
         got.append(targets)
         got.append(dependencies)
         got.append(changed)
         got.append(task)
     task = Task('Fake', [py_callable], file_dep=['dependencies'],
                 targets=['targets'])
     task.dep_changed = ['changed']
     task.options = {}
     my_action = task.actions[0]
     my_action.execute()
     assert got == [['targets'], ['dependencies'], ['changed'],
                    task]
开发者ID:pydoit,项目名称:doit,代码行数:17,代码来源:test_action.py

示例7: test_task_meta_reference

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
    def test_task_meta_reference(self):
        cmd = "%s %s/myecho.py" % (executable, TEST_PATH)
        cmd += " %(dependencies)s - %(changed)s - %(targets)s"
        dependencies = ["data/dependency1", "data/dependency2"]
        targets = ["data/target", "data/targetXXX"]
        task = Task('Fake', [cmd], dependencies, targets)
        task.dep_changed = ["data/dependency1"]
        task.options = {}
        my_action = task.actions[0]
        assert my_action.execute() is None

        got = my_action.out.split('-')
        assert task.file_dep == set(got[0].split())
        assert task.dep_changed == got[1].split()
        assert targets == got[2].split()
开发者ID:pydoit,项目名称:doit,代码行数:17,代码来源:test_action.py

示例8: test_action_modifies_task_but_not_attrs

# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import dep_changed [as 别名]
    def test_action_modifies_task_but_not_attrs(self):
        def py_callable(targets, dependencies, changed, task):
            targets.append('new_target')
            dependencies.append('new_dependency')
            changed.append('new_changed')
            task.file_dep.add('dep2')
        my_task = Task('Fake', [py_callable], file_dep=['dependencies'],
                    targets=['targets'])
        my_task.dep_changed = ['changed']
        my_task.options = {}
        my_action = my_task.actions[0]
        my_action.execute()

        assert my_task.file_dep == set(['dependencies', 'dep2'])
        assert my_task.targets == ['targets']
        assert my_task.dep_changed == ['changed']
开发者ID:pydoit,项目名称:doit,代码行数:18,代码来源:test_action.py


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