    def test_mirage(self):
        """
        Check that Mirage works.
        """
        # Check that Mirage randomly updates the Screen every other frame.
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        canvas = Canvas(screen, 10, 40, 0, 0)
        effect = Mirage(canvas, FigletText("hello"), 3, 1)
        effect.reset()
        effect.update(0)
        self.assert_blank(canvas)
        effect.update(1)
        changed = False
        for x in range(canvas.width):
            for y in range(canvas.height):
                if canvas.get_from(x, y) != (32, 7, 0, 0):
                    changed = True
        self.assertTrue(changed)

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

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