Пример #1
0
 def testDontForgetTaskDependency(self, tasks, depfile):
     self._add_task_deps(tasks, depfile.name)
     output = StringIO.StringIO()
     cmds.doit_forget(depfile.name, tasks, output, ["t3"])
     dep = Dependency(depfile.name)
     assert None == dep._get("t3", "dep")
     assert "1" == dep._get("t1", "dep")
Пример #2
0
 def testForgetOne(self, tasks):
     output = StringIO.StringIO()
     cmds.doit_forget(TESTDB, tasks, output, ["t2", "t1"])
     got = output.getvalue().split("\n")[:-1]
     assert ["forgeting t2", "forgeting t1"] == got
     dep = Dependency(TESTDB)
     assert None == dep._get("t1", "dep")
     assert None == dep._get("t2", "dep")
Пример #3
0
 def testForgetAll(self, tasks):
     output = StringIO.StringIO()
     cmds.doit_forget(TESTDB, tasks, output, [])
     got = output.getvalue().split("\n")[:-1]
     assert ["forgeting all tasks"] == got, repr(output.getvalue())
     dep = Dependency(TESTDB)
     for task in tasks:
         assert None == dep._get(task.name, "dep")
Пример #4
0
 def testForgetOne(self, tasks, depfile):
     self._add_task_deps(tasks, depfile.name)
     output = StringIO.StringIO()
     cmds.doit_forget(depfile.name, tasks, output, ["t2", "t1"])
     got = output.getvalue().split("\n")[:-1]
     assert ["forgeting t2", "forgeting t1"] == got
     dep = Dependency(depfile.name)
     assert None == dep._get("t1", "dep")
     assert None == dep._get("t2", "dep")
     assert "1" == dep._get("g1.a", "dep")
Пример #5
0
    def testForgetAll(self, tasks, depfile):
        self._add_task_deps(tasks, depfile.name)
        output = StringIO.StringIO()
        cmds.doit_forget(depfile.name, tasks, output, [])
        got = output.getvalue().split("\n")[:-1]
        assert ["forgeting all tasks"] == got, repr(output.getvalue())
#        assert False
        dep = Dependency(depfile.name)
        for task in tasks:
            assert None == dep._get(task.name, "dep")
Пример #6
0
    def testForgetGroup(self, tasks):
        output = StringIO.StringIO()
        cmds.doit_forget(TESTDB, tasks, output, ["g2"])
        got = output.getvalue().split("\n")[:-1]
        assert "forgeting g2" == got[0]

        dep = Dependency(TESTDB)
        assert None == dep._get("t1", "dep")
        assert "1" == dep._get("t2", "dep")
        assert None == dep._get("g1", "dep")
        assert None == dep._get("g1.a", "dep")
        assert None == dep._get("g1.b", "dep")
        assert None == dep._get("g2", "dep")
Пример #7
0
def cmd_forget(params, args):
    """execute cmd 'forget' """
    dodo_tasks = loader.get_tasks(*_path_params(params))
    params.update_defaults(dodo_tasks['config'])
    options = args or dodo_tasks['config'].get('default_tasks')
    return doit_forget(params['dep_file'], dodo_tasks['task_list'],
                       sys.stdout, options)
Пример #8
0
 def testDontForgetTaskDependency(self, tasks):
     output = StringIO.StringIO()
     cmds.doit_forget(TESTDB, tasks, output, ["t3"])
     dep = Dependency(TESTDB)
     assert None == dep._get("t3", "dep")
     assert "1" == dep._get("t1", "dep")