Skip to content

Commit

Permalink
tests: fix missing / in sqlite paths
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Jan 10, 2025
1 parent 7e01008 commit a25bfe0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/app/test_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,19 @@ def test_configuration_from_environment_vars(tmp_path):
"""Canaille should read configuration from environment vars."""
os.environ["SECRET_KEY"] = "very-very-secret"
os.environ["CANAILLE__SMTP__FROM_ADDR"] = "[email protected]"
os.environ["CANAILLE_SQL__DATABASE_URI"] = f"sqlite://{tmp_path}/anything.db"
os.environ["CANAILLE_SQL__DATABASE_URI"] = f"sqlite:///{tmp_path}/anything.db"

conf = settings_factory({"TIMEZONE": "UTC"})
assert conf.SECRET_KEY == "very-very-secret"
assert conf.CANAILLE.SMTP.FROM_ADDR == "[email protected]"
assert conf.CANAILLE_SQL.DATABASE_URI == f"sqlite://{tmp_path}/anything.db"
assert conf.CANAILLE_SQL.DATABASE_URI == f"sqlite:///{tmp_path}/anything.db"

app = create_app({"TIMEZONE": "UTC"})
assert app.config["SECRET_KEY"] == "very-very-secret"
assert app.config["CANAILLE"]["SMTP"]["FROM_ADDR"] == "[email protected]"
assert (
app.config["CANAILLE_SQL"]["DATABASE_URI"] == f"sqlite://{tmp_path}/anything.db"
app.config["CANAILLE_SQL"]["DATABASE_URI"]
== f"sqlite:///{tmp_path}/anything.db"
)

del os.environ["SECRET_KEY"]
Expand Down

0 comments on commit a25bfe0

Please sign in to comment.