From 954f3448460137d5dd10d87305ef9b11f27d36ae Mon Sep 17 00:00:00 2001 From: jrybicki-jsc <j.rybicki@fz-juelich.de> Date: Mon, 13 Sep 2021 09:40:43 +0200 Subject: [PATCH] oid --- dags/b2shareoperator.py | 2 +- tests/test_b2shareoperator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dags/b2shareoperator.py b/dags/b2shareoperator.py index cdc40e4..1824dac 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 1cfb0d0..702e087 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 -- GitLab