forked from dbpedia/databus-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
30 lines (22 loc) · 728 Bytes
/
conftest.py
File metadata and controls
30 lines (22 loc) · 728 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
import types
# Provide a lightweight fake SPARQLWrapper module for tests when not installed.
if "SPARQLWrapper" not in sys.modules:
mod = types.ModuleType("SPARQLWrapper")
mod.JSON = None
class DummySPARQL:
def __init__(self, *args, **kwargs):
pass
def setQuery(self, q):
self._q = q
def setReturnFormat(self, f):
self._fmt = f
def setCustomHttpHeaders(self, h):
self._headers = h
def query(self):
class R:
def convert(self):
return {"results": {"bindings": []}}
return R()
mod.SPARQLWrapper = DummySPARQL
sys.modules["SPARQLWrapper"] = mod