aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-09-19 18:46:08 +0300
committerBonfaceKilz2024-09-23 12:32:51 +0300
commitc8145a42ea1e0a4192ca9fea1a9d47e0dec033a9 (patch)
treeafefcadb2c3a838b82959deb64eab3ab3c017cfa /tests
parent63c9fd8d5e19b4538a4f5f0edf0794e0a929deee (diff)
downloadgenenetwork3-c8145a42ea1e0a4192ca9fea1a9d47e0dec033a9.tar.gz
Make sure the the test graph is empty before running rdf tests.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/fixtures/rdf.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/fixtures/rdf.py b/tests/fixtures/rdf.py
index a5fd711..93a7c23 100644
--- a/tests/fixtures/rdf.py
+++ b/tests/fixtures/rdf.py
@@ -30,10 +30,15 @@ def rdf_setup():
os.path.dirname(__file__).split("fixtures")[0],
"test_data/ttl-files/test-data.ttl",
)
+
# Define the query parameters and authentication
params = {"graph": "http://cd-test.genenetwork.org"}
auth = HTTPDigestAuth(
sparql_conf["sparql_user"], sparql_conf["sparql_password"])
+
+ # Make sure this graph does not exist before running anything
+ requests.delete(url, params=params, auth=auth)
+
# Open the file in binary mode and send the request
with open(file_path, "rb") as file:
response = requests.put(url, params=params, auth=auth, data=file)