From c8145a42ea1e0a4192ca9fea1a9d47e0dec033a9 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 19 Sep 2024 18:46:08 +0300 Subject: Make sure the the test graph is empty before running rdf tests. Signed-off-by: Munyoki Kilyungi --- tests/fixtures/rdf.py | 5 +++++ 1 file changed, 5 insertions(+) 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) -- cgit v1.2.3