Пример #1
0
    def test_command_not_implemented(self):
        class TaskA(Task):
            pass

        t = TaskA() << Popen('exit 1', shell=True)
        with self.assertRaisesRegex(NotImplementedError,
                                    'implement your own build'):
            t.make()
Пример #2
0
    def test_empty_targets_not_executed(self):
        class EmptyTargets(Task):
            def build(self, *args):
                raise Exception(
                    'If called, the test fails')  # pragma: no cover

        t = EmptyTargets() << Popen('exit 0', shell=True)
        t.make()
Пример #3
0
    def test_empty_targets_executed(self):
        class EmptyTargets(Task):
            def build(self, *args):
                raise BuildException('I have been called')

        t = EmptyTargets() << Popen('exit 1', shell=True)
        with self.assertRaisesRegex(BuildException, 'I have been called'):
            t.make()
Пример #4
0
 def target(self):
     return Popen('exit %d' % self.target_exit_value, shell=True)
Пример #5
0
 def test_exit_1_1(self):
     e = ExitTask(1) << Popen('exit 1', shell=True)
     with self.assertRaisesRegex(Exception, 'I have been called'):
         e.make()
Пример #6
0
 def test_exit_0_0(self):
     e = ExitTask(0) << Popen('exit 0', shell=True)
     e.make()