def test_search_events_no_session_api_key(self, mock_get):
        """Test event retrieval without a session API key."""
        # Create event store without session_api_key
        event_store = NestedEventStore(
            base_url='http://test-api.example.com',
            sid='test-session',
            user_id='test-user',
        )

        # Setup mock response
        mock_events = [create_mock_event(1, 'Hello', 'user')]
        mock_get.return_value = create_mock_response(mock_events)

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

        # Verify the results
        assert len(events) == 1

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