aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/db/rdf/test_wiki.py
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-09-19 15:10:36 +0300
committerBonfaceKilz2024-09-23 12:32:51 +0300
commita744e12cba6b7122eec5f5fe5ade78f26e6af18e (patch)
treee9266c49c535da2bd9971403dcdf55c6849b331d /tests/unit/db/rdf/test_wiki.py
parent95896dd1da002742267f68bfafe69e2a11ba603a (diff)
downloadgenenetwork3-a744e12cba6b7122eec5f5fe5ade78f26e6af18e.tar.gz
Use test fixtures to set-up a test named graph.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'tests/unit/db/rdf/test_wiki.py')
-rw-r--r--tests/unit/db/rdf/test_wiki.py11
1 files changed, 6 insertions, 5 deletions
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 = "<http://cd-test.genenetwork.org>"
@@ -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 = {