Skip to content

Commit

Permalink
test get_dag_details
Browse files Browse the repository at this point in the history
  • Loading branch information
zachliu committed Feb 23, 2021
1 parent 896c558 commit 9dd495b
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/integration/test_get_dag_details.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Airflow API (Stable)
Apache Airflow management API. # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: zach.z.liu@gmail.com
Generated by: https://openapi-generator.tech
"""

import logging

from test.integration.conftest import BCOLORS

import pytest

from airflow_python_sdk.model.time_delta import TimeDelta

@pytest.mark.parametrize(
"test_input, expected",
[
(["example_bash_operator"], TimeDelta(
type="TimeDelta",
days=0,
seconds=3600,
microseconds=0,
)),
(["test_glue_partitions_sensor"], None),
],
)
def test_get_dag(dag_api_setup, test_input, expected):
"""Test the /dags/{dag_id} API EP"""
dag_id, = test_input
api_response = dag_api_setup.get_dag_details(
dag_id=dag_id,
)
logging.getLogger().info("%s", api_response)
print(f"{BCOLORS.OKGREEN}OK{BCOLORS.ENDC}")
assert api_response.dag_run_timeout == expected

0 comments on commit 9dd495b

Please sign in to comment.