Exemple #1
0
    def test_requeue_stopped_block(self):
        """
        _requeue_handler() clears both requeue and stop events
        """
        child = DummyProcessBlock(parent=ZombieBlock())

        # Requeue
        child.events["requeue"].set()
        child._requeue_handler()

        self.assertFalse(child.events["requeue"].is_set())
        self.assertFalse(child.events["stop"].is_set())
Exemple #2
0
    def test_requeue_end_obj(self):
        """
        'end object' aka None do not get requeued
        """
        parent = DummyProcessBlock()
        child = DummyProcessBlock(parent=parent)

        child.objs.put(None)

        # Requeue
        child.events["requeue"].set()
        child._requeue_handler()

        # Ensure the child's object queue is actually emptied
        self.assertEqual(parent.objs.qsize(), 0)