Skip to content

Commit

Permalink
Merge pull request #798 from MTES-MCT/feat-test-dbt-cli
Browse files Browse the repository at this point in the history
Ajout d'un test pour vérifier la disponibilité du CLI de DBT sur Airflow
  • Loading branch information
alexisig authored Dec 23, 2024
2 parents 5447bb7 + 22a093e commit e8c25b1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions airflow/tests/test_dbt_cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import subprocess

import pytest


def test_dbt_cli_is_available():
"""
Teste si le cli dbt est disponible depuis la commande dbt
"""
try:
subprocess.run(["dbt", "--help"], check=True)
except FileNotFoundError:
pytest.fail("La commande dbt n'est pas disponible")
except subprocess.CalledProcessError as e:
pytest.fail(f"La commande dbt a retourné une erreur: {e}")

0 comments on commit e8c25b1

Please sign in to comment.