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)
def test_invalid_key(self, pdep_manager): t1 = Task('t1', None) t1.values = {'x': 5, 'y': 10} pdep_manager.save_success(t1) pytest.raises(Exception, pdep_manager.get_value, 't1', 'z')
def test_ok_dot_on_task_name(self, pdep_manager): t1 = Task('t1:a.ext', None) t1.values = {'x': 5, 'y': 10} pdep_manager.save_success(t1) assert 5 == pdep_manager.get_value('t1:a.ext', 'x')
def test_ok(self, pdep_manager): t1 = Task('t1', None) t1.values = {'x': 5, 'y': 10} pdep_manager.save_success(t1) assert 5 == pdep_manager.get_value('t1', 'x')
def test_all_values(self, pdep_manager): t1 = Task('t1', None) t1.values = {'x': 5, 'y': 10} pdep_manager.save_success(t1) assert {'x': 5, 'y': 10} == pdep_manager.get_values('t1')
def test_save_values(self, pdep_manager): t1 = Task('t1', None) t1.values = {'x': 5, 'y': 10} pdep_manager.save_success(t1) assert {'x': 5, 'y': 10} == pdep_manager._get("t1", "_values_:")
def test_invalid_taskid(self, pdepfile): t1 = Task('t1', None) t1.values = {'x': 5, 'y': 10} pdepfile.save_success(t1) pytest.raises(Exception, pdepfile.get_value, 'nonono', 'x')
def test_invalid_key(self, pdepfile): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} pdepfile.save_success(t1) pytest.raises(Exception, pdepfile.get_value, 't1', 'z')
def test_ok_dot_on_task_name(self, pdepfile): t1 = Task('t1:a.ext', None) t1.values = {'x':5, 'y':10} pdepfile.save_success(t1) assert 5 == pdepfile.get_value('t1:a.ext', 'x')
def test_ok(self, pdepfile): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} pdepfile.save_success(t1) assert 5 == pdepfile.get_value('t1', 'x')
def test_all_values(self, pdepfile): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} pdepfile.save_success(t1) assert {'x':5, 'y':10} == pdepfile.get_values('t1')
def test_save_values(self, pdepfile): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} pdepfile.save_success(t1) assert {'x':5, 'y':10} == pdepfile._get("t1", "_values_:")
def test_invalid_arg(self, depfile): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} depfile.save_success(t1) py.test.raises(Exception, depfile.get_value, 't1.z')
def test_invalid_taskid(self, depfile): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} depfile.save_success(t1) pytest.raises(Exception, depfile.get_value, 'nonono', 'x')
def test_invalid_taskid(self, pdep_manager): t1 = Task('t1', None) t1.values = {'x':5, 'y':10} pdep_manager.save_success(t1) pytest.raises(Exception, pdep_manager.get_value, 'nonono', 'x')