Created
September 8, 2019 06:43
-
-
Save chandulal/5089406230483da87b1d35b76feee96b 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 sys | |
import unittest | |
sys.path.append('../') | |
from airflow_api import AirflowAPI | |
class TestHelloWorldDag(unittest.TestCase): | |
"""Integration test for Hello world DAG""" | |
def setUp(self): | |
self.airflow_api = AirflowAPI() | |
def test_hello_world(self): | |
"""helloword dag should run successfully""" | |
execution_date = "2019-01-11T12:00:00+00:00" | |
dag_id = "hello_world" | |
self.airflow_api.trigger_dag(dag_id, execution_date) | |
is_running = True | |
while is_running: | |
is_running = self.airflow_api.is_dag_running(dag_id, execution_date) | |
self.assertEqual(is_running, False) | |
self.assertEqual(self.airflow_api.get_dag_status(dag_id, execution_date), "success") | |
if __name__ == '__main__': | |
unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment