-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: fix missing / in sqlite paths
- Loading branch information
Showing
1 changed file
with
4 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"] | ||
|