init
This commit is contained in:
commit
fe636432d0
154 files changed
+30381
No files matched your search
@@ -0,0 +1,24 @@
|
||||
from app.config import Settings
|
||||
|
||||
|
||||
def test_settings_default_to_sqlite_when_no_database_url_override():
|
||||
settings = Settings(database_url="", database_backend="sqlite")
|
||||
assert settings.database_url == "sqlite:///./document_cleaning.db"
|
||||
|
||||
|
||||
def test_settings_select_postgres_url_from_backend_choice():
|
||||
settings = Settings(
|
||||
database_url="",
|
||||
database_backend="postgres",
|
||||
postgres_database_url="postgresql://postgres:difyai123456@localhost:5432/doccleaning_db",
|
||||
)
|
||||
assert settings.database_url == "postgresql+psycopg://postgres:difyai123456@localhost:5432/doccleaning_db"
|
||||
|
||||
|
||||
def test_settings_keep_database_url_override_highest_priority():
|
||||
settings = Settings(
|
||||
database_backend="sqlite",
|
||||
database_url="postgresql://postgres:difyai123456@localhost:5432/doccleaning_db",
|
||||
sqlite_database_url="sqlite:///./other.db",
|
||||
)
|
||||
assert settings.database_url == "postgresql+psycopg://postgres:difyai123456@localhost:5432/doccleaning_db"
|
||||
Reference in new issue
Block a user