Lee-W commented on code in PR #66367:
URL: https://github.com/apache/airflow/pull/66367#discussion_r3186924263


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py:
##########
@@ -1389,6 +1389,52 @@ def test_should_update_assets_endpoint(self, 
test_client, session):
                 assert asset["last_asset_event"]["timestamp"] is None
 
 
+class TestPostAssetEventsTeamResolution(TestAssets):
+    """Tests for team-based filtering in create_asset_event."""
+
+    _ROUTE = "airflow.api_fastapi.core_api.routes.public.assets"
+
+    def _make_mock_event(self, asset):
+        evt = mock.MagicMock(spec=AssetEvent)
+        evt.id, evt.asset_id, evt.uri, evt.name, evt.group = 1, asset.id, 
asset.uri, asset.name, asset.group
+        evt.extra, evt.source_map_index, evt.timestamp = {"from_rest_api": 
True}, -1, DEFAULT_DATE
+        evt.source_task_id = evt.source_dag_id = evt.source_run_id = 
evt.partition_key = None
+        evt.created_dagruns = []
+        return evt

Review Comment:
   ```suggestion
       def _make_mock_event(self, asset):
           return mock.MagicMock(
               spec=AssetEvent,
               id=1,
               asset_id=asset.id,
               uri=asset.uri,
               name=asset.name,
               group=asset.group,
               extra={"from_rest_api": True},
               source_map_index=-1,
               timestamp=DEFAULT_DATE,
               source_task_id=None,
               source_dag_id=None,
               source_run_id=None,
               partition_key=None,
               created_dagruns=[],
         )
   ```



-- 
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]

Reply via email to