Skip to content

Commit

Permalink
tests: Add test for serializing distribution temporal_resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
kovalch committed Nov 13, 2023
1 parent e5e237d commit d64622f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions ckanext/dcatapchharvest/tests/fixtures/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
"https://geoportal.sachsen.de/md/685a4409-a026-430e-afad-1fa2881f9700",
"https://example.com/my-great-data-service-1"
],
"temporal_resolution":"P1D",
"rights": "http://dcat-ap.ch/vocabulary/licenses/terms_by_ask",
"license": "http://dcat-ap.ch/vocabulary/licenses/cc-by/4.0",
"media_type": "1d-interleaved-parityfec"
Expand Down
7 changes: 5 additions & 2 deletions ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

import nose

from rdflib import Literal
from rdflib import URIRef, Literal, XSD
from rdflib.namespace import RDF

from ckanext.dcat import utils
from ckanext.dcat.processors import RDFSerializer
from ckanext.dcat.profiles import DCAT, DCT, FOAF, OWL, SCHEMA, XSD

from rdflib import URIRef
import ckanext.dcatapchharvest.dcat_helpers as dh

from ckanext.dcatapchharvest.tests.base_test_classes import BaseSerializeTest
Expand Down Expand Up @@ -129,6 +128,10 @@ def test_graph_from_dataset(self):
if resource_dict.get('format') == "1d-interleaved-parityfec":
assert self._triple(g, distribution, DCT['format'], URIRef("http://www.iana.org/assignments/video/1d-interleaved-parityfec"))

if resource_dict.get('temporal_resolution') == "P1D":
expected_literal = Literal("P1D", datatype=XSD.duration)
assert self._triple(g, distribution, DCAT.temporalResolution, expected_literal)


def test_graph_from_dataset_uri(self):
"""Tests that datasets (resources) with a uri from the test system
Expand Down

0 comments on commit d64622f

Please sign in to comment.