"""VCR integration tests for OpenReviewClient."""

from __future__ import annotations

from typing import Any

import pytest

from axm_bib.clients.openreview import OpenReviewClient
from axm_bib.models import Paper


@pytest.mark.vcr
class TestOpenReviewVCR:
    """Replay recorded OpenReview API responses."""

    def test_search(self, vcr_cassette: Any) -> None:
        """Search returns parsed Paper objects from real API response."""
        client = OpenReviewClient()
        papers = client.search("attention mechanism", limit=3)

        assert isinstance(papers, list)
        assert len(papers) > 0
        assert all(isinstance(p, Paper) for p in papers)
        assert all(p.source == "openreview" for p in papers)
