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_elsevier_live.py
View on GitHub"""Live API tests for Scopus and ScienceDirect.
These tests intentionally call Elsevier APIs through the local pybliometrics
configuration. They are not mocked.
"""
from __future__ import annotations
import asyncio
import json
import os
import pytest
from sources import ScienceDirectSource, ScopusSource
pytestmark = pytest.mark.skipif(
os.getenv("NATURE_ACADEMIC_SEARCH_LIVE_ELSEVIER") != "1",
reason="set NATURE_ACADEMIC_SEARCH_LIVE_ELSEVIER=1 to run live Elsevier API tests",
)
ELSEVIER_DOI = "10.1016/j.istruc.2024.107944"
ELSEVIER_TITLE_QUERY = (
"Seismic performance continuous rigid-frame bridges flood-induced scour"
)
def _call_tool_json(tool_name: str, arguments: dict) -> dict:
from academic_search_server import mcp
content, _metadata = asyncio.run(mcp.call_tool(tool_name, arguments))
return json.loads(content[0].text)
def test_scopus_live_search_exact_doi():
result = ScopusSource().search(f"DOI({ELSEVIER_DOI})", rows=1)
assert result["source"] == "scopus"
assert result["total"] >= 1
assert len(result["results"]) == 1
assert result["results"][0]["doi"] == ELSEVIER_DOI
def test_sciencedirect_live_search_title_query():
result = ScienceDirectSource().search(ELSEVIER_TITLE_QUERY, rows=1)
assert result["source"] == "sciencedirect"
assert result["total"] >= 1
assert len(result["results"]) == 1
assert result["results"][0]["doi"] == ELSEVIER_DOI
def test_sciencedirect_live_article_metadata_doi_query():
result = ScienceDirectSource().get_article_metadata(
f"doi({ELSEVIER_DOI})",
rows=1,
)
assert result["source"] == "sciencedirect"
assert result["total"] >= 1
assert len(result["results"]) == 1
assert result["results"][0]["doi"] == ELSEVIER_DOI
def test_default_search_papers_uses_free_sources_only():
payload = _call_tool_json(
"search_papers",
{"query": ELSEVIER_TITLE_QUERY, "rows": 1},
)
assert payload["sources_queried"] == ["crossref", "pubmed", "arxiv"]
assert "scopus" not in payload["sources_queried"]
assert "sciencedirect" not in payload["sources_queried"]
def test_explicit_search_papers_includes_elsevier_sources():
payload = _call_tool_json(
"search_papers",
{
"query": ELSEVIER_TITLE_QUERY,
"sources": ["scopus", "sciencedirect"],
"rows": 1,
},
)
assert payload["sources_queried"] == ["scopus", "sciencedirect"]
assert any(item["source"] == "scopus" for item in payload["results"])
assert any(item["source"] == "sciencedirect" for item in payload["results"])
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 |