    def test_cycle(self):
        """
        Check that Cycle works.
        """
        # Check that cycle swaps colours every other frame.
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        effect = Cycle(screen, StaticRenderer(images=["hello"]), 2)
        effect.reset()
        # First 2 calls should do nothing and use black.
        effect.update(0)
        screen.centre.assert_not_called()
        effect.update(1)
        screen.centre.assert_called_with("hello", 2, 0)
        # Next 2 calls should do nothing and use red.
        screen.centre.reset_mock()
        effect.update(2)
        screen.centre.assert_not_called()
        effect.update(3)
        screen.centre.assert_called_with("hello", 2, 1)

        # Check there is no stop frame
        self.assertEqual(effect.stop_frame, 0)

        # This effect should ignore events.
        event = object()
        self.assertEqual(event, effect.process_event(event))
Check that Cycle works.
tests/test_effects.py