forked from pybliometrics-dev/pybliometrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2db627
commit 6a37c1d
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
pybliometrics/sciencedirect/tests/test_ArticleEntitlement.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Tests for sciencedirect.ArticleEntitlement""" | ||
from pybliometrics.sciencedirect import ArticleEntitlement, init | ||
|
||
init() | ||
|
||
ae_1 = ArticleEntitlement('10.1016/j.reseneeco.2015.06.001', view='FULL', refresh=30) | ||
ae_2 = ArticleEntitlement('S0140988320302814', view='FULL', refresh=30) | ||
|
||
|
||
def test_all_fields(): | ||
assert ae_1.doi == '10.1016/j.reseneeco.2015.06.001' | ||
assert ae_1.eid == '1-s2.0-S092876551500038X' | ||
assert ae_1.entitled is True | ||
assert ae_1.identifier == 'http://dx.doi.org/10.1016/j.reseneeco.2015.06.001' | ||
assert ae_1.link == 'https://www.sciencedirect.com/science/article/pii/S092876551500038X' | ||
assert ae_1.message == 'Requestor is entitled to the requested resource' | ||
assert ae_1.pii == 'S0928-7655(15)00038-X' | ||
assert ae_1.pii_norm == 'S092876551500038X' | ||
assert ae_1.pubmed_id is None | ||
assert ae_1.scopus_id == '84935028440' | ||
assert ae_1.status == 'found' | ||
assert ae_1.url == 'https://api.elsevier.com/content/article/pii/S092876551500038X' | ||
|
||
|
||
def test_str(): | ||
expected_str = 'Requestor is entitled to the requested resource with doi: 10.1016/j.eneco.2020.104941' | ||
assert ae_2.__str__() == expected_str | ||
|
||
|
||
test_all_fields() | ||
test_str() |