def test_search_events_with_filter(self, mock_exclude, mock_get, event_store):
        """Test event retrieval with an EventFilter."""
        # Setup mock response with mixed events
        mock_events = [
            create_mock_event(1, 'Hello', 'user'),
            create_mock_event(2, 'World', 'agent'),
            create_mock_event(3, 'Hidden', 'user'),
        ]
        mock_get.return_value = create_mock_response(mock_events)

        # Configure the mock to exclude the third event (simulating exclude_hidden=True)
        # Return True for the third event (to exclude it) and False for others
        mock_exclude.side_effect = [False, False, True]

        # Create a filter (the actual implementation doesn't matter since we're mocking exclude)
        event_filter = EventFilter()

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

        # Verify the results (should exclude the third event)
        assert len(events) == 2
        assert events[0].id == 1
        assert events[1].id == 2

        # 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 an EventFilter.
tests/unit/test_nested_event_store.py