    def test_dynamic_path(self):
        """
        Check a dynamic path works as expected.
        """
        class TestPath(DynamicPath):
            def process_event(self, event):
                # Assume that we're always passing in a MouseEvent.
                self._x = event.x
                self._y = event.y

        # Initial path should start at specified location.
        path = TestPath(None, 0, 0)
        self.assertEqual(path.next_pos(), (0, 0))
        self.assertFalse(path.is_finished())

        # Process event should move location.
        path.process_event(MouseEvent(10, 5, 0))
        self.assertEqual(path.next_pos(), (10, 5))

        # Reset should return to original location.
        path.reset()
        self.assertEqual(path.next_pos(), (0, 0))
Check a dynamic path works as expected.
tests/test_paths.py