diff --git a/dags/b2shareoperator.py b/dags/b2shareoperator.py index cdc40e4117ffec3ed62d0c23714ee489454fa07e..1824dac4e2cf2181f297df91f5e90121e1fa4b3b 100644 --- a/dags/b2shareoperator.py +++ b/dags/b2shareoperator.py @@ -44,7 +44,7 @@ class B2ShareOperator(BaseOperator): def execute(self, **kwargs): hook = HttpHook(http_conn_id=self.conn_id, method='GET') - + print(kwargs) params = kwargs['context']['params'] oid = params['oid'] hrespo = hook.run(endpoint=f"/api/records/{oid}") diff --git a/tests/test_b2shareoperator.py b/tests/test_b2shareoperator.py index 1cfb0d0066464caf517214a895b606ad2f98a24e..702e0875a9418389835d5b72ef34e92ddced5fe3 100644 --- a/tests/test_b2shareoperator.py +++ b/tests/test_b2shareoperator.py @@ -20,7 +20,7 @@ class B2ShareOperatorTest(unittest.TestCase): def test_execute_no_trigger(self): - self.ti.run(ignore_ti_state=False) + self.ti.run(ignore_ti_state=False, context={'params': {'oid': 111}}) print(self.ti.state) self.assertEqual(State.SUCCESS, self.ti.state) # Assert something related to tasks results \ No newline at end of file