Skip to content

Commit

Permalink
Merge pull request #54 from shauryr/spelling-fixes-ObjectNotFoundExce…
Browse files Browse the repository at this point in the history
…ption

Spelling fixes object not found exception
  • Loading branch information
danielnsilva committed Aug 11, 2023
2 parents da433a1 + 5e332c2 commit 881bd9a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions semanticscholar/ApiRequester.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
wait_fixed)

from semanticscholar.SemanticScholarException import \
BadQueryParametersException, ObjectNotFoundExeception
BadQueryParametersException, ObjectNotFoundException


class ApiRequester:
Expand Down Expand Up @@ -75,7 +75,7 @@ def get_data(
raise PermissionError('HTTP status 403 Forbidden.')
elif r.status_code == 404:
data = r.json()
raise ObjectNotFoundExeception(data['error'])
raise ObjectNotFoundException(data['error'])
elif r.status_code == 429:
raise ConnectionRefusedError('HTTP status 429 Too Many Requests.')
elif r.status_code in [500, 504]:
Expand Down
4 changes: 2 additions & 2 deletions semanticscholar/SemanticScholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_paper(
:param list fields: (optional) list of the fields to be returned.
:returns: paper data
:rtype: :class:`semanticscholar.Paper.Paper`
:raises: ObjectNotFoundExeception: if Paper ID not found.
:raises: ObjectNotFoundException: if Paper ID not found.
'''

if not fields:
Expand Down Expand Up @@ -375,7 +375,7 @@ def get_author(
:param str author_id: S2AuthorId.
:returns: author data
:rtype: :class:`semanticscholar.Author.Author`
:raises: ObjectNotFoundExeception: if Author ID not found.
:raises: ObjectNotFoundException: if Author ID not found.
'''

if not fields:
Expand Down
2 changes: 1 addition & 1 deletion semanticscholar/SemanticScholarException.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ class BadQueryParametersException(SemanticScholarException):
'''Invalid query params or unsupported fields.'''


class ObjectNotFoundExeception(SemanticScholarException):
class ObjectNotFoundException(SemanticScholarException):
'''Paper or Author ID not found'''
4 changes: 2 additions & 2 deletions tests/test_semanticscholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from semanticscholar.Reference import Reference
from semanticscholar.SemanticScholar import SemanticScholar
from semanticscholar.SemanticScholarException import (
BadQueryParametersException, ObjectNotFoundExeception)
BadQueryParametersException, ObjectNotFoundException)
from semanticscholar.Tldr import Tldr

test_vcr = vcr.VCR(
Expand Down Expand Up @@ -238,7 +238,7 @@ def test_not_found(self):
methods = [self.sch.get_paper, self.sch.get_author]
for method in methods:
with self.subTest(subtest=method.__name__):
self.assertRaises(ObjectNotFoundExeception, method, 0)
self.assertRaises(ObjectNotFoundException, method, 0)

@test_vcr.use_cassette
def test_bad_query_parameters(self):
Expand Down

0 comments on commit 881bd9a

Please sign in to comment.