def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.idle_delay = 1
        config.quit_on_empty_queue = True

        tm = TaskManager(config, task_func=Mock())

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)

        assert tm.task_func.call_count == 10
        assert waiting_func.call_count == 0
Exemple #2
0
    def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.idle_delay = 1
        config.quit_on_empty_queue = True

        tm = TaskManager(config, task_func=Mock())

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)

        assert tm.task_func.call_count == 10
        assert waiting_func.call_count == 0
Exemple #3
0
    def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.logger = self.logger
        config.idle_delay = 1
        config.quit_on_empty_queue = True

        tm = TaskManager(config, task_func=Mock())

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)

        eq_(tm.task_func.call_count, 10)
        eq_(waiting_func.call_count, 0)
Exemple #4
0
    def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.logger = self.logger
        config.idle_delay = 1
        config.quit_on_empty_queue = True

        tm = TaskManager(config, task_func=Mock())

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)

        eq_(tm.task_func.call_count, 10)
        eq_(waiting_func.call_count, 0)