diff --git a/.gitignore b/.gitignore index e8fece7..3dc86d6 100644 --- a/.gitignore +++ b/.gitignore @@ -205,3 +205,6 @@ cython_debug/ marimo/_static/ marimo/_lsp/ __marimo__/ + + +endpoints.txt \ No newline at end of file diff --git a/test/conftest.py b/test/conftest.py index e3ea2fc..f9e9851 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -66,3 +66,26 @@ def _seed(db): db.flush() group_model.user_rel.append(user_model) db.commit() + +# # Produces a text file with method and path for every endpoint in the API +# from fastapi.routing import APIRoute +# +# def get_testable_routes(): +# routes = [] +# +# for route in app.routes: +# if not isinstance(route, APIRoute): +# continue +# +# for method in route.methods: +# if method in {"HEAD", "OPTIONS"}: +# continue +# +# routes.append((route.path, method)) +# +# return routes +# +# +# with open("endpoints.txt", "w") as f: +# for ep in get_testable_routes(): +# f.write(f"{ep[1]} {ep[0]}\n")