Skip to content

Commit 191c8bc

Browse files
committed
fix unit tests and remove APPLICATION STAC and JUPYTER SPEC schema conformation from experiment ogc record
1 parent 502cb7a commit 191c8bc

3 files changed

Lines changed: 20 additions & 8 deletions

File tree

deep_code/tests/utils/test_dataset_stac_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,11 @@ def setUp(self, mock_data_store):
6565
self.generator = OscDatasetStacGenerator(
6666
dataset_id="mock-dataset-id",
6767
collection_id="mock-collection-id",
68+
workflow_id="dummy",
69+
workflow_title="test",
6870
access_link="s3://mock-bucket/mock-dataset",
6971
documentation_link="https://example.com/docs",
72+
license_type="proprietary",
7073
osc_status="ongoing",
7174
osc_region="Global",
7275
osc_themes=["climate", "environment"],

deep_code/tests/utils/test_ogc_api_record.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import unittest
22

3-
from deep_code.constants import OGC_API_RECORD_SPEC
3+
from deep_code.constants import (
4+
APPLICATION_STAC_EXTENSION_SPEC,
5+
APPLICATION_TYPE_JUPYTER_SPEC,
6+
OGC_API_RECORD_SPEC,
7+
)
48
from deep_code.utils.ogc_api_record import (
59
Contact,
610
ExperimentAsOgcRecord,
@@ -136,7 +140,9 @@ def test_record_properties_to_dict(self):
136140

137141
class TestLinksBuilder(unittest.TestCase):
138142
def test_build_theme_links_for_records(self):
139-
links_builder = LinksBuilder(themes=["climate", "ocean"])
143+
links_builder = LinksBuilder(
144+
themes=["climate", "ocean"], jupyter_kernel_info={}
145+
)
140146
theme_links = links_builder.build_theme_links_for_records()
141147

142148
expected_links = [
@@ -201,7 +207,14 @@ def test_workflow_as_ogc_record_initialization(self):
201207
workflow_record.jupyter_notebook_url, "https://example.com/notebook.ipynb"
202208
)
203209
self.assertEqual(workflow_record.properties, record_properties)
204-
self.assertEqual(workflow_record.conformsTo, [OGC_API_RECORD_SPEC])
210+
self.assertEqual(
211+
workflow_record.conformsTo,
212+
[
213+
OGC_API_RECORD_SPEC,
214+
APPLICATION_TYPE_JUPYTER_SPEC,
215+
APPLICATION_STAC_EXTENSION_SPEC,
216+
],
217+
)
205218
self.assertEqual(workflow_record.links[0]["rel"], "root")
206219
self.assertEqual(workflow_record.links[-1]["rel"], "self")
207220

deep_code/utils/ogc_api_record.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,7 @@ def __init__(
316316
if linkTemplates is None:
317317
linkTemplates = []
318318
if conformsTo is None:
319-
conformsTo = [
320-
OGC_API_RECORD_SPEC,
321-
APPLICATION_TYPE_JUPYTER_SPEC,
322-
APPLICATION_STAC_EXTENSION_SPEC,
323-
]
319+
conformsTo = [OGC_API_RECORD_SPEC]
324320
self.id = id
325321
self.title = title
326322
self.type = type

0 commit comments

Comments
 (0)