Lee-W commented on code in PR #45960:
URL: https://github.com/apache/airflow/pull/45960#discussion_r1976777938
##########
task_sdk/tests/execution_time/test_context.py:
##########
@@ -354,3 +363,51 @@ def test__get_item__asset_ref(self, access_key, asset,
mock_supervisor_comms):
assert len(outlet_event_accessors) == 1
assert outlet_event_accessor.key == internal_key
assert outlet_event_accessor.extra == {}
+
+
+TEST_INLETS = [
+ Asset(name="test_uri", uri="test://test"),
+ AssetAlias(name="name"),
+ Asset.ref(name="test_uri"),
+ Asset.ref(uri="test://test/"),
+]
+
+
+class TestInletEventAccessor:
+ @pytest.fixture
+ def sample_inlet_evnets_accessor(self, mock_supervisor_comms):
+ mock_supervisor_comms.get_message.side_effect = [
+ AssetResult(name="test_uri", uri="test://test", group="asset"),
+ AssetResult(name="test_uri", uri="test://test", group="asset"),
+ ]
+ return InletEventsAccessors(inlets=TEST_INLETS)
+
+ @pytest.mark.usefixtures("mock_supervisor_comms")
+ def test__iter__(self, sample_inlet_evnets_accessor):
+ for actual, expected in zip(sample_inlet_evnets_accessor, TEST_INLETS):
+ assert actual == expected
+
+ @pytest.mark.usefixtures("mock_supervisor_comms")
+ def test__len__(self, sample_inlet_evnets_accessor):
+ # len(TEST_INLETS)
Review Comment:
updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]