def testDontIgnoreTaskDependency(self, tasks, depfile): output = StringIO.StringIO() cmd = Ignore(outstream=output, dep_file=depfile.name, task_list=tasks) cmd._execute(["t3"]) dep = Dependency(depfile.name) assert '1' == dep._get("t3", "ignore:") assert None == dep._get("t1", "ignore:")
def testIgnoreAll(self, tasks, depfile): output = StringIO.StringIO() cmd = Ignore(outstream=output, dep_file=depfile.name, task_list=tasks) cmd._execute([]) 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() cmd = Ignore(outstream=output, dep_file=depfile.name, task_list=tasks) cmd._execute(["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() cmd = Ignore(outstream=output, dep_file=depfile.name, task_list=tasks) cmd._execute(["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 testIgnoreInvalid(self, tasks, depfile_name): output = StringIO() cmd = Ignore(outstream=output, dep_file=depfile_name, backend='dbm', task_list=tasks) pytest.raises(InvalidCommand, cmd._execute, ["XXX"])