ObsiGate 2.83.1 : barre v0.2.0, onglet ShaarIt + garde data-theme (tests/test_draco_config.py)
This commit is contained in:
@@ -19,7 +19,8 @@ def env_propre(monkeypatch):
|
|||||||
"""Aucune variable d'URL d'écosystème posée (défauts officiels)."""
|
"""Aucune variable d'URL d'écosystème posée (défauts officiels)."""
|
||||||
for nom in (
|
for nom in (
|
||||||
"DRACO_AGENT_URL", "DRACO_OBSIGATE_URL", "DRACO_FLOWDECK_URL",
|
"DRACO_AGENT_URL", "DRACO_OBSIGATE_URL", "DRACO_FLOWDECK_URL",
|
||||||
"DRACO_TIKTAK_URL", "DRACO_KANBANTE_URL", "DRACO_GITEA_URL",
|
"DRACO_TIKTAK_URL", "DRACO_KANBANTE_URL", "DRACO_SHAARIT_URL",
|
||||||
|
"DRACO_GITEA_URL",
|
||||||
"AGENT_EVENEMENTS_URL",
|
"AGENT_EVENEMENTS_URL",
|
||||||
):
|
):
|
||||||
monkeypatch.delenv(nom, raising=False)
|
monkeypatch.delenv(nom, raising=False)
|
||||||
@@ -37,6 +38,20 @@ def test_defauts_officiels_sans_dev(env_propre):
|
|||||||
assert "-dev" not in url
|
assert "-dev" not in url
|
||||||
|
|
||||||
|
|
||||||
|
def test_shaarit_defaut_et_derivation(env_propre):
|
||||||
|
"""Barre v0.2.0 : ShaarIt suit le même mécanisme que les autres
|
||||||
|
sœurs — défaut officiel, dérivation -dev depuis l'hôte de l'agent,
|
||||||
|
variable explicite prioritaire."""
|
||||||
|
assert draco_config.app_url("shaarit") == "https://shaarit.dracodev.net"
|
||||||
|
env_propre.setenv(
|
||||||
|
"AGENT_EVENEMENTS_URL", "https://agent-dev.dracodev.net/api/v1/evenements")
|
||||||
|
assert draco_config.app_url("shaarit") == "https://shaarit-dev.dracodev.net"
|
||||||
|
assert draco_config.urls_publiques()["shaarit"] == \
|
||||||
|
"https://shaarit-dev.dracodev.net"
|
||||||
|
env_propre.setenv("DRACO_SHAARIT_URL", "https://bm.example.net/")
|
||||||
|
assert draco_config.app_url("shaarit") == "https://bm.example.net"
|
||||||
|
|
||||||
|
|
||||||
def test_agent_derive_des_evenements(env_propre):
|
def test_agent_derive_des_evenements(env_propre):
|
||||||
"""Sans DRACO_AGENT_URL, l'origine suit AGENT_EVENEMENTS_URL —
|
"""Sans DRACO_AGENT_URL, l'origine suit AGENT_EVENEMENTS_URL —
|
||||||
la configuration réelle du poste (dev inclus)."""
|
la configuration réelle du poste (dev inclus)."""
|
||||||
|
|||||||
Reference in New Issue
Block a user