Exemple #1
0
    def test_perform4(self, iterable_interface):
        """Test performing a simple loop no timing. Continue

        """
        self.task.interface = iterable_interface
        for i, t in enumerate([ContinueTask(name='break', condition='True'),
                               CheckTask(name='check')]):
            self.task.add_child_task(i, t)

        self.root.prepare()

        self.task.perform()
        assert not self.task.children[1].perform_called
Exemple #2
0
    def test_perform3(self):
        """Test handling of BreakTask and ContinueTask.

        """
        self.task.condition = 'True'
        self.task.add_child_task(0, BreakTask(name='Break', condition='True'))
        self.task.add_child_task(
            0, ContinueTask(name='Continue', condition='{Test_index} < 5'))

        self.root.prepare()

        self.task.perform()
        assert not self.check.perform_called
        assert self.task.get_from_database('Test_index') == 5
Exemple #3
0
    def test_perform_timing3(self, iterable_interface):
        """Test performing a simple loop timing. Continue.

        """
        self.task.interface = iterable_interface
        self.task.timing = True
        self.task.add_child_task(
            0, ContinueTask(name='Continue', condition='True'))
        self.task.add_child_task(1, CheckTask(name='check'))

        self.root.prepare()

        self.task.perform()
        assert not self.task.children[1].perform_called
        assert self.root.get_from_database('Test_elapsed_time') != 1.0
Exemple #4
0
    def test_perform_task3(self, iterable_interface):
        """Test performing a loop with an embedded task no timing. Continue.

        """
        self.task.interface = iterable_interface
        self.task.task = CheckTask(name='check')
        self.task.add_child_task(
            0, ContinueTask(name='Continue', condition='True'))
        self.task.children.append(CheckTask(name='check'))
        self.root.prepare()

        self.task.perform()
        assert self.root.get_from_database('Test_index') == 11
        assert self.task.task.perform_called
        assert self.task.task.perform_value == 10
        assert not self.task.children[1].perform_called
Exemple #5
0
def test_continue_view(exopy_qtbot):
    """Test the ContinueTask view.

    """
    show_and_close_widget(exopy_qtbot,
                          ContinueView(task=ContinueTask(name='Test')))