本文整理汇总了Python中doit.task.Task.result方法的典型用法代码示例。如果您正苦于以下问题:Python Task.result方法的具体用法?Python Task.result怎么用?Python Task.result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类doit.task.Task
的用法示例。
在下文中一共展示了Task.result方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_save_result
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_save_result(self, pdepfile):
t1 = Task('t_name', None)
t1.result = "result"
pdepfile.save_success(t1)
assert get_md5("result") == pdepfile._get(t1.name, "result:")
pdepfile.remove_success(t1)
assert None is pdepfile._get(t1.name, "result:")
示例2: test_resultDependencies
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_resultDependencies(self, depfile):
# t1 ok, but t2 not saved
t1 = Task('t1', None)
t1.result = "result"
t2 = Task('t2', None, result_dep=['t1'])
depfile.save_success(t1)
assert 'run' == depfile.get_status(t2)
# save t2 - ok
depfile.save_success(t2)
assert 'up-to-date' == depfile.get_status(t2)
# change t1
t1.result = "another"
depfile.save_success(t1)
assert 'run' == depfile.get_status(t2)
示例3: test_save_result_dep
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_save_result_dep(self, depfile):
t1 = Task('t1', None)
t1.result = "result"
depfile.save_success(t1)
t2 = Task('t2', None, result_dep=['t1'])
depfile.save_success(t2)
assert get_md5(t1.result) == depfile._get("t2", "task:t1")
t3 = Task('t3', None, task_dep=['t1'])
depfile.save_success(t3)
assert None is depfile._get("t3", "task:t1")
示例4: test_values_and_results
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_values_and_results(self, depfile, dependency1):
my_task = Task("t2", [""], file_dep=['tests/data/dependency1'])
my_task.result = "result"
my_task.values = {'x': 5, 'y': 10}
depfile.save_success(my_task)
depfile.checker = TimestampChecker() # trigger task update
reseted = Task("t2", [""], file_dep=['tests/data/dependency1'])
output = StringIO()
cmd_reset = CmdFactory(ResetDep, outstream=output, task_list=[reseted],
dep_manager=depfile)
cmd_reset._execute()
got = output.getvalue()
assert "processed t2\n" == got
assert {'x': 5, 'y': 10} == depfile.get_values(reseted.name)
assert get_md5('result') == depfile.get_result(reseted.name)
示例5: test_save_result_dict
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_save_result_dict(self, pdepfile):
t1 = Task('t_name', None)
t1.result = {'d': "result"}
pdepfile.save_success(t1)
assert {'d': "result"} == pdepfile._get(t1.name, "result:")
示例6: test_save_result_hash
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_save_result_hash(self, pdepfile):
t1 = Task('t_name', None)
t1.result = "result"
pdepfile.save_success(t1, result_hash='abc')
assert 'abc' == pdepfile._get(t1.name, "result:")
示例7: test_save_result
# 需要导入模块: from doit.task import Task [as 别名]
# 或者: from doit.task.Task import result [as 别名]
def test_save_result(self, pdep_manager):
t1 = Task('t_name', None)
t1.result = "result"
pdep_manager.save_success(t1)
assert get_md5("result") == pdep_manager._get(t1.name, "result:")
assert get_md5("result") == pdep_manager.get_result(t1.name)