コード例 #1
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
 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:")
コード例 #2
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
 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:")
コード例 #3
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
 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:")
コード例 #4
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
 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:")
コード例 #5
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
 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:")
コード例 #6
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
 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:")
コード例 #7
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
    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:")
コード例 #8
0
ファイル: test_cmd_ignore.py プロジェクト: swayf/doit
    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:")
コード例 #9
0
 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"])