diff --git a/pywis_topics/topics.py b/pywis_topics/topics.py index 5ee3ed0..18b589c 100644 --- a/pywis_topics/topics.py +++ b/pywis_topics/topics.py @@ -211,7 +211,7 @@ def _validate_esd_subtopic(self, esd_subtopic: str, if strict: LOGGER.debug('Validating subtopic with strict mode') - is_experimental = esd_subtopic.split('/')[1] == 'experimental' + is_experimental = '/experimental' in esd_subtopic return esd_subtopic in self.topics[-1] or is_experimental tokens = esd_subtopic.split('/') diff --git a/tests/run_tests.py b/tests/run_tests.py index 58df03b..2610e5c 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -137,6 +137,12 @@ def test_validate(self): value = 'cache/a/wis2/ca-eccc-msc/data/core/weather/experimental/surface-based-observations' # noqa self.assertTrue(self.th.validate(value)) + value = 'origin/a/wis2/ca-eccc-msc/data/core/ocean' # noqa + self.assertTrue(self.th.validate(value)) + + value = 'cache/a/wis2/ca-eccc-msc/data/core/ocean' # noqa + self.assertTrue(self.th.validate(value)) + value = 'cache/a/wis2/ca-eccc-msc/data/core/weather/surface-based-observations/#' # noqa self.assertTrue(self.th.validate(value, strict=False)) self.assertFalse(self.th.validate(value))