added queries for patents and projects

This commit is contained in:
Kazgatari
2026-07-14 23:19:05 +02:00
parent e9d268ff9f
commit e1e9ffa8ec
@@ -0,0 +1,30 @@
import pytest
from inse.university_ranking.trend_strategies import PatentsTrendStrategy, ProjectsTrendStrategy
@pytest.mark.anyio
async def test_patents_trend_strategy():
strategy = PatentsTrendStrategy()
res = await strategy.get_trend(
topics=["Biotechnology and Related Fields"],
fuzzy=True,
institutions=["https://openalex.org/I62318514"]
)
assert res is not None
assert len(res.series) > 0
series_ude = [s for s in res.series if s.entity_id == "https://openalex.org/I62318514"]
assert len(series_ude) == 1
assert "Biotechnology and Related Fields" in series_ude[0].topic_data
@pytest.mark.anyio
async def test_projects_trend_strategy():
strategy = ProjectsTrendStrategy()
res = await strategy.get_trend(
topics=["Biotechnology and Related Fields"],
fuzzy=True,
institutions=["https://openalex.org/I62318514"]
)
assert res is not None
assert len(res.series) > 0
series_ude = [s for s in res.series if s.entity_id == "https://openalex.org/I62318514"]
assert len(series_ude) == 1
assert "Biotechnology and Related Fields" in series_ude[0].topic_data