File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 11"""
22Simple examples showing how to use the SPARQLStore
33"""
4+ from urllib .request import urlopen
5+ import sys
46
57from rdflib import Graph , Namespace , URIRef
68from rdflib .plugins .stores .sparqlstore import SPARQLUpdateStore , SPARQLStore
1820
1921# THIS WILL ADD DATA TO THE /db dataset
2022
23+
24+ HOST = "http://localhost:3030"
25+ try :
26+ assert len (urlopen (HOST ).read ()) > 0
27+ except Exception :
28+ print (f"{ HOST } is unavailable." )
29+ sys .exit (126 )
30+
2131if __name__ == "__main__" :
2232 dbo = Namespace ("http://dbpedia.org/ontology/" )
2333 dbr = Namespace ("http://dbpedia.org/resource/" )
Original file line number Diff line number Diff line change @@ -39,11 +39,7 @@ def test_example(example_file: Path) -> None:
3939
4040 try :
4141 result .check_returncode ()
42- except subprocess .CalledProcessError :
43- if (
44- example_file .stem == "sparqlstore_example"
45- and "http.client.RemoteDisconnected: Remote end closed connection without response"
46- in result .stderr .decode ("utf-8" )
47- ):
48- pytest .skip ("this test uses dbpedia which is down sometimes" )
42+ except subprocess .CalledProcessError as process_error :
43+ if (process_error .returncode == 126 ):
44+ pytest .skip ("This test returned 126 indikating to skip it." )
4945 raise
You can’t perform that action at this time.
0 commit comments