Created
August 4, 2022 17:13
-
-
Save goodbyegangster/0664470a7ae6de217b88d5cb53f10f6b to your computer and use it in GitHub Desktop.
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
import pytest | |
import pprint | |
from airflow.models import DagBag | |
class TestDag: | |
@pytest.fixture() | |
def dagbag(self): | |
return DagBag() | |
def test_dag_validation(self, dagbag): | |
dag = dagbag.get_dag(dag_id="sample_test_dag") | |
assert dagbag.import_errors == {} | |
assert dag is not None | |
assert dag.catchup is False | |
assert dag.doc_md != "" | |
print(type(dag)) | |
pprint.pprint(vars(dag)) | |
tasks = dag.tasks | |
task_ids = list(map(lambda task: task.task_id, tasks)) | |
print(f"tasks: {task_ids}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment