Пример #1
0
 def test_clean_default(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks,
                       config={'default_tasks':['t1']})
     cmd_clean._execute(False, False, False)
     # default enable --clean-dep by default
     assert ['t2', 't1'] == self.cleaned
Пример #2
0
 def test_clean_selected(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output,
                       task_list=tasks,
                       config={'default_tasks': ['t1']})
     cmd_clean._execute(False, False, False, ['t2'])
     assert ['t2'] == self.cleaned
Пример #3
0
 def test_clean_default(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output,
                       task_list=tasks,
                       config={'default_tasks': ['t1']})
     cmd_clean._execute(False, False, False)
     # default enable --clean-dep by default
     assert ['t2', 't1'] == self.cleaned
Пример #4
0
 def test_clean_invalid_task(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output,
                       task_list=tasks,
                       config={'default_tasks': ['t1']})
     pytest.raises(InvalidCommand, cmd_clean._execute, False, False, False,
                   ['xxxx'])
Пример #5
0
 def test_clean_taskdep_once(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, True, False, ['t1', 't2'])
     assert ['t2', 't1'] == self.cleaned
Пример #6
0
 def test_clean_subtasks(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, False, False, ['t3'])
     assert ['t3:a', 't3'] == self.cleaned
Пример #7
0
 def test_clean_taskdep_once(self, tasks):
     # do not execute clean operation more than once
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, True, False, ['t1', 't2'])
     assert ['t2', 't1'] == self.cleaned
Пример #8
0
 def test_clean_subtasks(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, False, False, ['t3'])
     assert ['t3:a', 't3'] == self.cleaned
Пример #9
0
 def test_clean_taskdep_recursive(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, True, False, ['t4'])
     assert ['t2', 't1', 't4'] == self.cleaned
Пример #10
0
 def test_clean_selected(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks,
                       config={'default_tasks':['t1']})
     cmd_clean._execute(False, False, False, ['t2'])
     assert ['t2'] == self.cleaned
Пример #11
0
 def test_clean_default_all(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, False, False)
     # default enable --clean-dep by default
     assert set(['t1','t2', 't3:a', 't3', 't4']) == set(self.cleaned)
Пример #12
0
 def test_clean_all(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, False, True)
     assert ['t1','t2', 't3:a', 't3', 't4'] == self.cleaned
Пример #13
0
 def test_clean_default_all(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, False, False)
     # default enable --clean-dep by default
     assert set(['t1', 't2', 't3:a', 't3', 't4']) == set(self.cleaned)
Пример #14
0
 def test_clean_all(self, tasks):
     output = StringIO()
     cmd_clean = Clean(outstream=output, task_list=tasks)
     cmd_clean._execute(False, False, True)
     assert ['t1', 't2', 't3:a', 't3', 't4'] == self.cleaned