Yuan1z0825/nature-skills / skills/nature-academic-search
nature-academic-search
FlaggedSearch literature across sources, verify or manage citations, and build MeSH strategies or citation-impact audits. Use for 文献检索、引文核对、参考文献管理、严格他引 and evidence-backed citer profiles; not for translating a paper or drafting manuscript prose.
mcp-server/tests/test_arxiv_error_entries.py
View on GitHub"""arXiv error entries must not become fake papers."""
from __future__ import annotations
from unittest.mock import patch
import pytest
from utils.errors import DataSourceError
ATOM = "http://www.w3.org/2005/Atom"
def _feed(entry_xml: str) -> str:
return f'<feed xmlns="{ATOM}">{entry_xml}</feed>'
def test_arxiv_error_entry_is_not_a_paper():
from sources.arxiv import ArxivSource
feed = _feed(
"<entry><id>http://arxiv.org/api/errors#incorrect_id_format_for_2401.99999</id>"
"<title>Error</title><summary>incorrect id format</summary></entry>"
)
assert ArxivSource()._parse_feed(feed) == []
def test_arxiv_get_by_id_reports_not_found_for_an_error_entry():
from sources.arxiv import ArxivSource
feed = _feed(
"<entry><id>http://arxiv.org/api/errors#incorrect_id_format_for_2401.99999</id><title>Error</title></entry>"
)
source = ArxivSource()
with patch.object(ArxivSource, "_request", return_value=feed):
with pytest.raises(DataSourceError, match="not found"):
source.get_by_id("2401.99999")
def test_arxiv_real_entry_still_parses():
from sources.arxiv import ArxivSource
feed = _feed(
"<entry><id>http://arxiv.org/abs/2401.00001v1</id><title>Real Title</title>"
"<summary>S</summary><author><name>A B</name></author></entry>"
)
papers = ArxivSource()._parse_feed(feed)
assert [p["title"] for p in papers] == ["Real Title"]
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |