HTML 77.2%
TypeScript 10.5%
Python 9.6%
JavaScript 2.5%
1import pytest23from aiatlas.connectors.research.arxiv import ArxivConnector, _arxiv_id, _split_names4from aiatlas.sdk.facts import Target5from tests.conftest import claims_of, extract_from_fixture, fixture_path678@pytest.fixture9def connector() -> ArxivConnector:10 return ArxivConnector({"atom_pages": 2})111213async def test_discover(connector):14 targets = await connector.discover(None) # type: ignore[arg-type]15 assert [t.key for t in targets] == ["atom:0", "atom:1", "rss:cs.LG", "rss:cs.CL", "rss:cs.AI", "rss:cs.CV"]16 assert "start=200&max_results=200" in targets[1].url and connector.rate_per_min == 417 assert [t.key for t in await ArxivConnector().discover(None)] == ["rss:cs.LG", "rss:cs.CL", "rss:cs.AI", "rss:cs.CV"] # Atom opt-in181920async def test_atom(connector):21 target = Target(url="https://export.arxiv.org/api/query?search_query=cat:cs.LG&start=0&max_results=200", doc_type="feed", key="atom:0")22 facts = await extract_from_fixture(connector, target, fixture_path("arxiv", "atom-page0.xml"), content_type="application/atom+xml")23 papers = [e for e in facts.entities if e.entity_type == "paper"]24 assert len(papers) == 200 and papers[0].identifiers == {"arxiv": "2609.11929"} # version suffix stripped25 c = claims_of(facts, papers[0].name)26 assert c["primary_category"] == "cs.CV" and c["published_at"] == "2026-09-10T17:59:55+00:00"27 assert c["pdf_url"] == "https://arxiv.org/pdf/2609.11929" and c["authors"][0] == "Haiwen Diao" and c["abstract"].startswith("We launch SenseNova")28 assert c["comment"].startswith("Project page")29 # no name-only researchers any more: the Atom feed carries no author identifier (ORCID), so authors stay a claim on the paper30 assert not any(e.entity_type == "researcher" for e in facts.entities) and not any(r.predicate == "authored" for r in facts.relations)31 assert len(c["authors"]) >= 332 assert not any(t.needs_llm for t in facts.targets) and facts.targets == []333435async def test_rss(connector):36 target = Target(url="https://rss.arxiv.org/rss/cs.LG", doc_type="feed", key="rss:cs.LG")37 facts = await extract_from_fixture(connector, target, fixture_path("arxiv", "rss-cs-lg.xml"), content_type="application/rss+xml")38 papers = [e for e in facts.entities if e.entity_type == "paper"]39 assert len(papers) >= 200 and papers[0].identifiers == {"arxiv": "2609.10559"}40 c = claims_of(facts, papers[0].name)41 assert c["authors"] == ["Wenzhe Jin", "Haina Tang"] and c["arxiv_announce_type"] == "new"42 assert c["abstract"].startswith("To address") and "Announce Type" not in c["abstract"]43 assert c["categories"] == ["cs.LG", "cs.CV"]444546def test_helpers():47 assert _arxiv_id("http://arxiv.org/abs/2609.11929v1") == "2609.11929"48 assert _arxiv_id("oai:arXiv.org:2609.10559v2") == "2609.10559"49 assert _split_names("Wenzhe Jin, Haina Tang and Someone Else") == ["Wenzhe Jin", "Haina Tang", "Someone Else"]50