added queries for patents and projects
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user