Skip to content

Commit

Permalink
tests: Add test for serializing distribution access services
Browse files Browse the repository at this point in the history
  • Loading branch information
bellisk committed Nov 7, 2023
1 parent 0afca3c commit dba8179
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ckanext/dcatapchharvest/tests/fixtures/dataset.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@
"https://example.com/documentation-resource-1",
"https://example.com/documentation-resource-2"
],
"access_services": [
"https://geoportal.sachsen.de/md/685a4409-a026-430e-afad-1fa2881f9700",
"https://example.com/my-great-data-service-1"
],
"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
4 changes: 4 additions & 0 deletions ckanext/dcatapchharvest/tests/test_dcatap_ch_serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def test_graph_from_dataset(self):
for link in resource_dict.get("documentation", []):
assert self._triple(g, distribution, FOAF.page, URIRef(link))

eq_(len([t for t in g.triples((distribution, DCAT.accessService, None))]), 2)
for link in distribution.get("access_services", []):
assert self._triple(g, distribution, DCAT.accessService, URIRef(link))

# e2c50e70-67ad-4f86-bb1b-3f93867eadaa
if resource_dict.get('rights') == 'Creative Commons CC Zero License (cc-zero)':
assert self._triple(g, distribution, DCT.rights, URIRef("http://dcat-ap.de/def/licenses/cc-zero"))
Expand Down

0 comments on commit dba8179

Please sign in to comment.