from fmatch.saas.main import create_app


def test_no_dupe_routes():
    app = create_app()
    seen = set()
    for r in app.router.routes:
        path = getattr(r, "path_format", None) or getattr(r, "path", None) or repr(r)
        methods = getattr(r, "methods", None) or {"ANY"}
        for m in methods:
            key = (m.upper(), (path or "").rstrip("/"))
            assert key not in seen, f"Duplicate route: {key}"
            seen.add(key)

