    def test_sprite(self):
        """
        Check that Sprites work.
        """
        # Check that we can move a Sprite around the screen.
        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        canvas = Canvas(screen, 10, 40, 0, 0)
        path = Path()
        path.jump_to(10, 5)
        path.move_straight_to(20, 10, 5)
        path.move_straight_to(30, 5, 5)
        path.move_straight_to(20, 0, 5)
        path.move_straight_to(10, 5, 5)
        effect = Sam(canvas, path)
        effect.reset()
        self.assert_blank(canvas)
        my_buffer = [[(32, 7, 0, 0) for _ in range(40)] for _ in range(10)]
        for i in range(30):
            effect.update(i)
            self.assertEqual(self.check_canvas(
                canvas,
                my_buffer,
                lambda value: self.assertLess(value[0], 129)),
                i % 2 == 0, "Bad update on frame %d" % i)

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

        # Static paths should pay no attention to events.
        event = object()
        self.assertEqual(event, effect.process_event(event))
Check that Sprites work.
tests/test_effects.py