def testIgnoreAll(self, tasks, depfile): output = StringIO.StringIO() cmds.doit_ignore(depfile.name, tasks, output, []) got = output.getvalue().split("\n")[:-1] assert ["You cant ignore all tasks! Please select a task."] == got, got dep = Dependency(depfile.name) for task in tasks: assert None == dep._get(task.name, "ignore:")
def testIgnoreOne(self, tasks, depfile): output = StringIO.StringIO() cmds.doit_ignore(depfile.name, tasks, output, ["t2", "t1"]) got = output.getvalue().split("\n")[:-1] assert ["ignoring t2", "ignoring t1"] == got dep = Dependency(depfile.name) assert '1' == dep._get("t1", "ignore:") assert '1' == dep._get("t2", "ignore:") assert None == dep._get("t3", "ignore:")
def testIgnoreGroup(self, tasks, depfile): output = StringIO.StringIO() cmds.doit_ignore(depfile.name, tasks, output, ["g2"]) got = output.getvalue().split("\n")[:-1] dep = Dependency(depfile.name) assert '1' == dep._get("t1", "ignore:"), got assert None == dep._get("t2", "ignore:") assert '1' == dep._get("g1", "ignore:") assert '1' == dep._get("g1.a", "ignore:") assert '1' == dep._get("g1.b", "ignore:") assert '1' == dep._get("g2", "ignore:")
def cmd_ignore(params, args): """execute cmd 'ignore' """ dodo_tasks = loader.get_tasks(params['dodoFile'], params['cwdPath'], params['sub'].keys()) params.update_defaults(dodo_tasks['config']) return doit_ignore(params['dep_file'], dodo_tasks['task_list'], sys.stdout, args)
def testDontIgnoreTaskDependency(self, tasks, depfile): output = StringIO.StringIO() cmds.doit_ignore(depfile.name, tasks, output, ["t3"]) dep = Dependency(depfile.name) assert '1' == dep._get("t3", "ignore:") assert None == dep._get("t1", "ignore:")
def testDontIgnoreTaskDependency(self, tasks): output = StringIO.StringIO() cmds.doit_ignore(TESTDB, tasks, output, ["t3"]) dep = Dependency(TESTDB) assert '1' == dep._get("t3", "ignore:") assert None == dep._get("t1", "ignore:")