fix(airflow): fiabilise l'import horaire de la Mock API
Airflow / Construction de l'image (push) Successful in 1m4s
Backend / Analyse statique de sécurité (push) Successful in 7s
Backend / Tests exigeant une base (push) Failing after 4m55s
Airflow / Lint et intégrité des DAGs (push) Successful in 9m49s
Backend / Lint, typage et tests (push) Successful in 10m12s
Backend / Audit des dépendances (push) Successful in 9m36s
SonarQube / build-front (push) Successful in 9m35s
SonarQube / test-ml (push) Failing after 5m37s
SonarQube / build-back (push) Successful in 9m46s
SonarQube / test-front (push) Failing after 5m4s
SonarQube / test-back (push) Failing after 5m9s
SonarQube / SonarQube (push) Skipped

This commit is contained in:
Meryemel-gham
2026-09-22 16:24:05 +02:00
parent d86224a0f7
commit e118c008bf
9 changed files with 113 additions and 40 deletions
@@ -283,6 +283,41 @@ def test_create_mock_api_client_requires_credentials(
mock_api_import.create_mock_api_client()
@pytest.mark.parametrize(
("username", "password_value"),
[
("", "test-password"),
("test-user", ""),
(" ", "test-password"),
("test-user", " "),
],
)
def test_create_mock_api_client_rejects_empty_credentials(
monkeypatch: pytest.MonkeyPatch,
username: str,
password_value: str,
) -> None:
password = MagicMock()
password.get_secret_value.return_value = password_value
settings = SimpleNamespace(
mock_api_username=username,
mock_api_password=password,
)
monkeypatch.setattr(
mock_api_import,
"get_settings",
lambda: settings,
)
with pytest.raises(
ValueError,
match="Les identifiants de l'API Mock ne sont pas configurés",
):
mock_api_import.create_mock_api_client()
async def test_create_mock_api_client_uses_configuration(
monkeypatch: pytest.MonkeyPatch,
) -> None: