Spaces:
Runtime error
Runtime error
Download backend/tests/test_db_engine_parity.py from Talosware/talos-access: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Talosware/talos-access/resolve/main/backend/tests/test_db_engine_parity.py
- Command line
-
hf download hf://spaces/Talosware/talos-access/backend/tests/test_db_engine_parity.py
-
curl -L -o test_db_engine_parity.py https://huggingface.co/spaces/Talosware/talos-access/resolve/main/backend/tests/test_db_engine_parity.py
1.02 kB
| """Regression guard: ensure the running app only talks PostgreSQL.""" | |
| from app.core.database import engine | |
| from app.core.config import settings | |
| def test_engine_dialect_is_postgres(): | |
| """The SQLAlchemy engine must use the postgresql dialect.""" | |
| assert engine.dialect.name == "postgresql", ( | |
| f"Expected postgresql dialect, got {engine.dialect.name}. " | |
| "Something is reintroducing MariaDB/MySQL — check config.py and requirements.txt." | |
| ) | |
| def test_database_url_does_not_contain_mysql(): | |
| """No DATABASE_URL path should produce a mysql:// URL.""" | |
| assert "mysql" not in settings.DATABASE_URL.lower() | |
| assert "pymysql" not in settings.DATABASE_URL.lower() | |
| def test_pymysql_not_installed(): | |
| """pymysql must not be importable — it was removed from requirements.""" | |
| import importlib | |
| try: | |
| importlib.import_module("pymysql") | |
| raise AssertionError("pymysql is still installed. Run: pip uninstall pymysql") | |
| except ImportError: | |
| pass # expected | |