From a744e12cba6b7122eec5f5fe5ade78f26e6af18e Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 19 Sep 2024 15:10:36 +0300 Subject: Use test fixtures to set-up a test named graph. Signed-off-by: Munyoki Kilyungi --- tests/unit/db/rdf/test_wiki.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/unit/db/rdf/test_wiki.py') diff --git a/tests/unit/db/rdf/test_wiki.py b/tests/unit/db/rdf/test_wiki.py index 99ecab0..a1500e9 100644 --- a/tests/unit/db/rdf/test_wiki.py +++ b/tests/unit/db/rdf/test_wiki.py @@ -1,6 +1,6 @@ """Tests for gn3/db/rdf/wiki.py""" from unittest import TestCase - +from tests.fixtures.rdf import rdf_setup, get_sparql_auth_conf import pytest import os @@ -12,6 +12,7 @@ from gn3.db.rdf.wiki import ( ) +SPARQL_CONF = get_sparql_auth_conf() GRAPH = "" @@ -168,11 +169,11 @@ def test_sanitize_result(result, expected): @pytest.mark.rdf -def test_get_wiki_entries_by_symbol(): +def test_get_wiki_entries_by_symbol(rdf_setup): """Test that wiki entries are fetched correctly by symbol""" result = get_wiki_entries_by_symbol( symbol="ckb", - sparql_uri=os.environ.get("SPARQL_ENDPOINT", "http://localhost:9082/sparql"), + sparql_uri=SPARQL_CONF["sparql_endpoint"], graph=GRAPH, ) expected = { @@ -239,10 +240,10 @@ def test_get_wiki_entries_by_symbol(): @pytest.mark.rdf -def test_get_comment_history(): +def test_get_comment_history(rdf_setup): result = get_comment_history( comment_id=1158, - sparql_uri=os.environ.get("SPARQL_ENDPOINT", "http://localhost:9082/sparql"), + sparql_uri=SPARQL_CONF["sparql_endpoint"], graph=GRAPH, ) expected = { -- cgit v1.2.3