Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-herrmann committed Aug 20, 2024
1 parent b2db627 commit 6a37c1d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions pybliometrics/sciencedirect/tests/test_ArticleEntitlement.py
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()

0 comments on commit 6a37c1d

Please sign in to comment.