示例#1
0
 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:")
示例#2
0
 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:")
示例#3
0
    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:")
示例#4
0
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)
示例#5
0
 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:")
示例#6
0
 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:")