Spaces:
Runtime error
Runtime error
Download tests/debug_assistant_routes.py from Darshankumarr03/Swift-Query: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/spaces/Darshankumarr03/Swift-Query/resolve/main/tests/debug_assistant_routes.py
- Command line
-
hf download hf://spaces/Darshankumarr03/Swift-Query/tests/debug_assistant_routes.py
-
curl -L -o debug_assistant_routes.py https://huggingface.co/spaces/Darshankumarr03/Swift-Query/resolve/main/tests/debug_assistant_routes.py
976 Bytes
| from flask import Flask, session | |
| from utils.blueprints.assistant import assistant_bp | |
| from utils.blueprints.admin import admin_bp | |
| app = Flask(__name__) | |
| app.config['SECRET_KEY'] = 'test' | |
| app.register_blueprint(assistant_bp) | |
| app.register_blueprint(admin_bp) | |
| # Mock DB for imports to work? | |
| # Actually, the blueprint imports mongo... we might need to mock it or set up app context. | |
| # To avoid complex mocking of mongo, I'll just check if the URL map contains the routes. | |
| print("--- Registered Routes ---") | |
| for rule in app.url_map.iter_rules(): | |
| print(f"{rule.endpoint}: {rule}") | |
| print("\n--- Checking specific URLs ---") | |
| urls_to_check = [ | |
| "/assistant/dashboard", | |
| "/assistant/dashboard/data_entry", | |
| "/assistant/dashboard/account_creation" | |
| ] | |
| adapter = app.url_map.bind("localhost") | |
| for url in urls_to_check: | |
| try: | |
| match = adapter.match(url) | |
| print(f"FOUND: {url} -> {match}") | |
| except Exception as e: | |
| print(f"MISSING: {url} -> {e}") | |