Alembic et le point d'entree lisent la configuration de l'application
build / Garde-fou (pull_request) Successful in 9m19s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Successful in 9m45s
build / Garde-fou (push) Successful in 9m19s
build / Images Harbor (web, Dockerfile) (push) Successful in 13m10s
build / Garde-fou (pull_request) Successful in 9m19s
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (pull_request) Skipped
build / Images Harbor (web, Dockerfile) (pull_request) Skipped
build / Images Harbor (catalog-sync, Dockerfile.catalog-sync) (push) Successful in 9m45s
build / Garde-fou (push) Successful in 9m19s
build / Images Harbor (web, Dockerfile) (push) Successful in 13m10s
This commit is contained in:
1 parent
acf72da7f8
commit
5766e24213
3 files changed
+26
-4
No files matched your search
@@ -7,6 +7,7 @@ ici, et la CI reste sans service externe.
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -303,3 +304,18 @@ def test_url_de_base_encode_les_caracteres_speciaux(monkeypatch):
|
||||
# L'URL porte la valeur encodee ; c'est le pilote qui la decode.
|
||||
assert morceaux.password == "p%40ss%3Aw0rd%2F%231"
|
||||
assert unquote(morceaux.password) == "p@ss:w0rd/#1"
|
||||
|
||||
|
||||
def test_le_point_d_entree_reconnait_les_deux_declarations_de_base():
|
||||
"""Les migrations doivent partir quelle que soit la facon de declarer la base."""
|
||||
script = Path("docker/entrypoint-web.sh").read_text(encoding="utf-8")
|
||||
condition = next(ligne for ligne in script.splitlines() if ligne.startswith("if ["))
|
||||
assert "ENCLUME_DATABASE_URL" in condition
|
||||
assert "ENCLUME_DB_HOTE" in condition
|
||||
|
||||
|
||||
def test_alembic_lit_la_configuration_de_l_application():
|
||||
"""Alembic et l'application doivent viser la meme base, sans divergence possible."""
|
||||
env = Path("migrations/env.py").read_text(encoding="utf-8")
|
||||
assert "Config.SQLALCHEMY_DATABASE_URI" in env
|
||||
assert 'os.environ.get("ENCLUME_DATABASE_URL"' not in env
|
||||
Reference in new issue
Block a user