Skip to content

Commit

Permalink
catch exception in search paper test
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Sep 23, 2023
1 parent f060080 commit d2ed146
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
# https://pypi.org/project/py-3rdparty-mediawiki/
'py-3rdparty-mediawiki>=0.8.1',
# https://pypi.org/project/semanticscholar/
'semanticscholar>=0.3.0',
'semanticscholar>=0.5.0',
# https://arthurdejong.org/python-stdnum/
'python-stdnum>=1.18',
# https://pypi.org/project/pyOnlineSpreadsheetEditing/
Expand Down
11 changes: 8 additions & 3 deletions tests/test_semantic_scholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def testGetPaper(self):
"""
doi="10.1007/978-3-030-49461-2"
paper=self.semscholar.get_paper(doi)
print(json.dumps(paper.raw_data,indent=2,default=str))
if self.debug:
print(json.dumps(paper.raw_data,indent=2,default=str))
pass

def testSearchAuthor(self):
Expand All @@ -44,6 +45,10 @@ def testSearchPaper(self):
"""
titles=["M. Agosti, C. Thanos (Eds). Post-proceedings of the First Italian Research Conference on Digital Library Management Systems (IRCDL 2005), Padova, 28th January, 2005. September 2005."]
for title in titles:
results=self.semscholar.sch.search_paper(title)
self.showResults(results)
try:
results=self.semscholar.sch.search_paper(title)
self.showResults(results)
except Exception as ex:
print(f"exception on testSearchPaper: {str(ex)}")
pass

0 comments on commit d2ed146

Please sign in to comment.