Skip to content
Snippets Groups Projects
Commit fdf67c82 authored by Jedrzej Rybicki's avatar Jedrzej Rybicki
Browse files

params in dag

parent 954f3448
No related branches found
No related tags found
No related merge requests found
Pipeline #78281 failed
......@@ -4,13 +4,15 @@ from airflow.utils.dates import days_ago
from dags.b2shareoperator import B2ShareOperator
from airflow import DAG
from airflow.models.taskinstance import TaskInstance
from tests.test_utils.config import conf_vars
DEFAULT_DATE = '2019-10-03'
TEST_DAG_ID = 'test_my_custom_operator'
class B2ShareOperatorTest(unittest.TestCase):
def setUp(self):
self.dag = DAG(TEST_DAG_ID, schedule_interval='@daily', default_args={'start_date' : days_ago(2)})
self.dag = DAG(TEST_DAG_ID, schedule_interval='@daily', default_args={'start_date' : days_ago(2)}, params={"oid": "111"})
self.op = B2ShareOperator(
dag=self.dag,
task_id='test',
......@@ -19,8 +21,8 @@ class B2ShareOperatorTest(unittest.TestCase):
self.ti = TaskInstance(task=self.op, execution_date=days_ago(1))
def test_execute_no_trigger(self):
self.ti.run(ignore_ti_state=False, context={'params': {'oid': 111}})
#with conf_vars({('params': {'oid': 1111})}):
self.ti.run(ignore_ti_state=False)
print(self.ti.state)
self.assertEqual(State.SUCCESS, self.ti.state)
# Assert something related to tasks results
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment