def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.number_of_threads = 2
        config.maximum_queue_size = 2
        config.quit_on_empty_queue = True

        calls = []

        def task_func(index):
            calls.append(index)

        tm = ThreadedTaskManager(config, task_func=task_func)

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)
        assert len(calls) == 10
    def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.number_of_threads = 2
        config.maximum_queue_size = 2
        config.quit_on_empty_queue = True

        calls = []

        def task_func(index):
            calls.append(index)

        tm = ThreadedTaskManager(config, task_func=task_func)

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)
        assert len(calls) == 10
    def test_blocking_start_with_quit_on_empty(self):
        config = DotDict()
        config.logger = self.logger
        config.number_of_threads = 2
        config.maximum_queue_size = 2
        config.quit_on_empty_queue =  True

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

        waiting_func = Mock()

        tm.blocking_start(waiting_func=waiting_func)

        eq_(
            tm.task_func.call_count,
            10
        )