Migrate location recorder and refine db config
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from app.config import Settings
|
||||
|
||||
|
||||
def test_settings_support_two_independent_database_urls(monkeypatch) -> None:
|
||||
monkeypatch.setenv("LOCATION_DATABASE_URL", "sqlite:///./data/locationRecorder.db")
|
||||
monkeypatch.setenv("POO_DATABASE_URL", "sqlite:///./data/pooRecorder.db")
|
||||
|
||||
settings = Settings()
|
||||
|
||||
assert settings.location_database_url == "sqlite:///./data/locationRecorder.db"
|
||||
assert settings.poo_database_url == "sqlite:///./data/pooRecorder.db"
|
||||
assert settings.location_sqlite_path is not None
|
||||
assert settings.location_sqlite_path.name == "locationRecorder.db"
|
||||
assert settings.poo_sqlite_path is not None
|
||||
assert settings.poo_sqlite_path.name == "pooRecorder.db"
|
||||
Reference in New Issue
Block a user