Spaces:
Running
Running
Download tests/test_subject_quartiles.py from nikeshn/researchbee: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/spaces/nikeshn/researchbee/resolve/main/tests/test_subject_quartiles.py
- Command line
-
hf download hf://spaces/nikeshn/researchbee/tests/test_subject_quartiles.py
-
curl -L -o test_subject_quartiles.py https://huggingface.co/spaces/nikeshn/researchbee/resolve/main/tests/test_subject_quartiles.py
1.36 kB
| from __future__ import annotations | |
| import app | |
| def test_subject_result_includes_all_field_quartiles(monkeypatch): | |
| monkeypatch.setattr(app, "lookup_any", lambda _issns: { | |
| "matched_issn": "1234-5678", | |
| "quartile": "Q1", | |
| "h_index": "88", | |
| "publisher": "Example Publisher", | |
| "open_access": "Yes", | |
| "country": "UAE", | |
| "categories": "Engineering (Q1); Energy (Q2)", | |
| "sourceid": "999", | |
| "quartiles_by_field": [ | |
| {"code": "2201", "field": "Engineering", "quartile": "Q1"}, | |
| {"code": "2102", "field": "Energy", "quartile": "Q2"}, | |
| ], | |
| "state": "indexed_ranked", | |
| "currently_indexed": True, | |
| "warn": False, | |
| }) | |
| monkeypatch.setattr(app, "build_verify_links", lambda *_args: {"scimago": "https://example.test"}) | |
| monkeypatch.setattr(app, "is_ku_apc_covered", lambda *_args: False) | |
| result = app.build_subject_journal_result({ | |
| "title": "Example Journal", | |
| "issn": "1234-5678", | |
| "quartile": "Q1", | |
| "h_index": 80, | |
| }) | |
| assert result["quartile"] == "Q1" | |
| assert result["quartiles_by_field"] == [ | |
| {"code": "2201", "field": "Engineering", "quartile": "Q1"}, | |
| {"code": "2102", "field": "Energy", "quartile": "Q2"}, | |
| ] | |
| assert result["h_index"] == 88 | |