from aiatlas.connectors.labs.apple_ml import FEED, AppleMLConnector from aiatlas.sdk.facts import Target from tests.conftest import claims_of, extract_from_fixture, fixture_path DISCOSIGN = "https://machinelearning.apple.com/research/discosign-gloss-translation" async def test_feed_papers(): facts = await extract_from_fixture(AppleMLConnector(), Target(url=FEED, doc_type="feed", key="feed"), fixture_path("apple_ml", "rss.xml"), content_type="text/xml") papers = [e for e in facts.entities if e.entity_type == "paper"] assert len(papers) == 10 disco = next(p for p in papers if p.name.startswith("DiscoSign")) assert disco.identifiers == {"url": DISCOSIGN} claims = claims_of(facts, disco.name) assert claims["published_at"] == "2026-09-11" and claims["abstract"].startswith("Sign language processing systems") assert sum(r.predicate == "published_by" for r in facts.relations) == 10 assert len(facts.events) == 10 and len([t for t in facts.targets if t.doc_type == "paper_page"]) == 10 async def test_paper_page(): target = Target(url=DISCOSIGN, doc_type="paper_page", key="paper:discosign-gloss-translation") facts = await extract_from_fixture(AppleMLConnector(), target, fixture_path("apple_ml", "paper-discosign.html")) paper = next(e for e in facts.entities if e.entity_type == "paper") assert paper.identifiers["arxiv"] == "2609.02796" claims = claims_of(facts, paper.name) assert claims["arxiv_id"] == "2609.02796" and claims["pdf_url"] == "https://arxiv.org/pdf/2609.02796" assert claims["authors"][0] == "Vasileios Baltatzis" and claims["authors"][-1] == "Colin Lea" and len(claims["authors"]) == 7 assert "published_at" not in claims # day-precision date comes from the feed only