Skip to content

Commit

Permalink
test_dblp.py: requests.exceptions.ConnectTimeout handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgp2 committed Jan 20, 2025
1 parent b789a45 commit cb05034
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions tests/test_dblp.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ def test_conference():
filters=BinaryPredicate("conference", "==", conference)
))
assert entries
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectTimeout
):
pass


Expand All @@ -50,7 +53,10 @@ def test_dblp_bibliography_without_pid():
try:
entries = DBLP.query(Query(object=fullname))
assert len(entries) > 0
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectTimeout
):
pass


Expand All @@ -59,7 +65,10 @@ def test_dblp_bibliography_with_pid():
try:
entries = DBLP.query(Query(object=fullname))
assert len(entries) > 0
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectTimeout
):
pass


Expand All @@ -82,7 +91,10 @@ def test_dblp_publication():
for entry in entries:
assert set(entry.keys()) == set(attributes)
assert entry["year"] == year
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectTimeout
):
pass


Expand All @@ -104,5 +116,8 @@ def test_dblp_researcher():
assert len(entries) == 2
assert len(entries[0]["authors"]) == 1
assert len(entries[1]["authors"]) == 3
except requests.exceptions.ReadTimeout:
except (
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectTimeout
):
pass

0 comments on commit cb05034

Please sign in to comment.