Skip to content

Commit

Permalink
Clean db in shacl tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Jul 16, 2024
1 parent 1aa6e0f commit 33b1b4d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions ckanext/dcat/tests/test_shacl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
import os
from random import randrange

from rdflib import URIRef
from pyshacl import validate
Expand All @@ -26,7 +25,6 @@ def graph_from_dataset(file_name):
if not file_name.startswith("ckan/"):
file_name = "ckan/" + file_name
dataset_dict = json.loads(get_file_contents(file_name))
dataset_dict["name"] += "-" + str(randrange(0, 1000))
dataset = call_action("package_create", **dataset_dict)

s = RDFSerializer()
Expand All @@ -48,7 +46,7 @@ def _results_count(results_graph):
)


@pytest.mark.usefixtures("with_plugins")
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
Expand All @@ -72,7 +70,7 @@ def test_validate_dcat_ap_2_graph_shapes():
assert conforms, results_text


@pytest.mark.usefixtures("with_plugins")
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
Expand All @@ -96,7 +94,7 @@ def test_validate_dcat_ap_2_graph_shapes_recommended():
assert conforms, results_text


@pytest.mark.usefixtures("with_plugins")
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat")
@pytest.mark.ckan_config("ckanext.dcat.rdf.profiles", "euro_dcat_ap_2")
def test_validate_dcat_ap_2_legacy_graph_shapes():
Expand All @@ -111,7 +109,7 @@ def test_validate_dcat_ap_2_legacy_graph_shapes():
assert conforms, results_text


@pytest.mark.usefixtures("with_plugins")
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat")
@pytest.mark.ckan_config("ckanext.dcat.rdf.profiles", "euro_dcat_ap_2")
def test_validate_dcat_ap_2_legacy_graph_shapes_recommended():
Expand All @@ -126,7 +124,7 @@ def test_validate_dcat_ap_2_legacy_graph_shapes_recommended():
assert conforms, results_text


@pytest.mark.usefixtures("with_plugins")
@pytest.mark.usefixtures("with_plugins", "clean_db")
@pytest.mark.ckan_config("ckan.plugins", "dcat scheming_datasets")
@pytest.mark.ckan_config(
"scheming.dataset_schemas", "ckanext.dcat.schemas:dcat_ap_2.1_full.yaml"
Expand Down

0 comments on commit 33b1b4d

Please sign in to comment.