Skip to content

Commit e49ef45

Browse files
committed
Add another test for citedby
1 parent 4cabc51 commit e49ef45

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test_module.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,17 @@ def test_citedby_1k_scholar(self):
841841
pub = next(pubs)
842842
self.check_citedby_1k(pub)
843843

844+
def test_citedby(self):
845+
"""Test that we can search citations of a paper from author's profile.
846+
"""
847+
# Retrieve the author's data, fill-in, and print
848+
search_query = scholarly.search_author('Steven A Cholewiak')
849+
author = scholarly.fill(next(search_query))
850+
pub = scholarly.fill(author['publications'][0])
851+
852+
# Which papers cited that publication?
853+
top10_citations = [citation for num, citation in enumerate(scholarly.citedby(pub)) if num<10]
854+
self.assertEqual(len(top10_citations), 10)
844855

845856
if __name__ == '__main__':
846857
unittest.main()

0 commit comments

Comments
 (0)