Skip to content

Commit 8cbf5d8

Browse files
committed
Add a unit test with a hyphenated keyword
1 parent 682b4a8 commit 8cbf5d8

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

test_module.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,29 @@ def test_search_keyword(self):
656656
self.assertEqual(author[key], expected_author[key])
657657
self.assertEqual(set(author["interests"]), set(expected_author["interests"]))
658658

659+
# Example 3
660+
expected_author = {'affiliation': "CEA, Département d'Astrophysique",
661+
'citedby': 98936,
662+
'email_domain': '@cea.fr',
663+
'filled': [],
664+
'interests': ['Cosmology (CMB',
665+
'weak-lensing',
666+
'large scale structure)',
667+
'Statistics',
668+
'Image Processing'],
669+
'name': 'Jean-Luc Starck',
670+
'scholar_id': 'IAaAiXgAAAAJ',
671+
'source': 'SEARCH_AUTHOR_SNIPPETS',
672+
'url_picture': 'https://scholar.google.com/citations?view_op=medium_photo&user=IAaAiXgAAAAJ'
673+
}
674+
search_query = scholarly.search_keyword('large-scale structure')
675+
author = next(search_query)
676+
for key in author:
677+
if (key not in {"citedby", "container_type", "interests"}) and (key in expected_author):
678+
self.assertEqual(author[key], expected_author[key])
679+
scholarly.pprint(author)
680+
self.assertEqual(set(author["interests"]), set(expected_author["interests"]))
681+
659682
def test_search_pubs(self):
660683
"""
661684
As of May 12, 2020 there are at least 29 pubs that fit the search term:

0 commit comments

Comments
 (0)