def test_search_events_with_type_filter(self, mock_get, event_store):
        """Test event retrieval with a type filter."""
        # Setup mock response with different event types
        mock_events = [
            create_mock_event(1, 'Hello', 'user'),
            # Create a different type of event (read)
            {
                'id': 2,
                'action': 'read',  # Using the correct ActionType.READ value
                'args': {
                    'path': '/test/file.txt',
                },
                'source': 'agent',
            },
            create_mock_event(3, 'Another', 'user'),
        ]
        mock_get.return_value = create_mock_response(mock_events)

        # Create a filter to include only MessageAction events
        event_filter = EventFilter(include_types=(MessageAction,))

        # Call the method with the filter
        events = list(event_store.search_events(filter=event_filter))

        # Verify the results (should only include MessageAction events)
        assert len(events) == 2
        assert events[0].id == 1
        assert events[1].id == 3

        # Verify the API call
        mock_get.assert_called_once_with(
            'http://test-api.example.com/events?start_id=0&reverse=False',
            headers={'X-Session-API-Key': 'test-api-key'},
        )
Test event retrieval with a type filter.
tests/unit/test_nested_event_store.py