Skip to content

Commit e56df6e

Browse files
committed
Fix graphFormatGuess test for when one of the expected endpoints are down
1 parent ea10f71 commit e56df6e

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

test/test_graph.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from tempfile import mkdtemp, mkstemp
66
import shutil
7+
from urllib.error import URLError, HTTPError
78

89
from rdflib import URIRef, Graph, plugin
910
from rdflib.exceptions import ParserError
@@ -304,10 +305,19 @@ def testGuessFormatForParse(self):
304305
with self.assertRaises(PluginException):
305306
self.graph.parse(location="https://www.google.com")
306307

307-
self.graph.parse(location="http://www.w3.org/ns/adms.ttl")
308-
self.graph.parse(location="http://www.w3.org/ns/adms.rdf")
309-
# persistent Australian Government online RDF resource without a file-like ending
310-
self.graph.parse(location="https://linked.data.gov.au/def/agrif?_format=text/turtle")
308+
try:
309+
self.graph.parse(location="http://www.w3.org/ns/adms.ttl")
310+
self.graph.parse(location="http://www.w3.org/ns/adms.rdf")
311+
except (URLError, HTTPError):
312+
#this endpoint is currently not available, ignore this test.
313+
pass
314+
315+
try:
316+
# persistent Australian Government online RDF resource without a file-like ending
317+
self.graph.parse(location="https://linked.data.gov.au/def/agrif?_format=text/turtle")
318+
except (URLError, HTTPError):
319+
# this endpoint is currently not available, ignore this test.
320+
pass
311321

312322

313323
# dynamically create classes for each registered Store

0 commit comments

Comments
 (0)