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:")
Esempio n. 2
0
 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:")
     pdep_manager.remove_success(t1)
     assert None is pdep_manager._get(t1.name, "result:")
Esempio n. 3
0
 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")
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
def test_unicode_md5():
    data = "我"
    # no exception is raised
    assert get_md5(data)
Esempio n. 7
0
 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:")
     assert get_md5("result") == pdepfile.get_result(t1.name)
Esempio n. 8
0
def test_unicode_md5():
    data = six.u("我")
    # no exception is raised
    assert get_md5(data)
def test_unicode_md5():
    data = "我"
    # no exception is raised
    assert get_md5(data)
Esempio n. 10
0
def test_unicode_md5():
    data = six.u("我")
    # no exception is raised
    assert get_md5(data)
Esempio n. 11
0
 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)