From d06de73fed7a4fa0c4cd0997cfca976a306a7958 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sun, 9 Jun 2024 11:17:24 -0400 Subject: [PATCH 1/3] delete conformance check to schema validation --- pywcmp/wcmp2/ets.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pywcmp/wcmp2/ets.py b/pywcmp/wcmp2/ets.py index dd5ed85..86c76c7 100644 --- a/pywcmp/wcmp2/ets.py +++ b/pywcmp/wcmp2/ets.py @@ -187,19 +187,12 @@ def test_requirement_conformance(self): Validate that a WCMP record provides valid conformance information. """ - conformance_class = 'http://wis.wmo.int/spec/wcmp/2/conf/core' - status = { 'id': gen_test_id('conformance'), - 'code': 'PASSED' + 'code': 'PASSED', + 'message': 'Passes given schema is compliant/valid' } - conformance = self.record.get('conformsTo') - - if conformance_class not in conformance: - status['code'] = 'FAILED' - status['message'] = f'Missing conformance class {conformance_class}' # noqa - return status def test_requirement_type(self): From b17437a74cba93e4ecf35bda7eb6b223d1b1d770 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sun, 9 Jun 2024 18:18:14 -0400 Subject: [PATCH 2/3] update tests --- tests/run_tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 915ea1f..1bb490e 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -79,8 +79,8 @@ def test_fail(self): codes = [r['code'] for r in results['ets-report']['tests']] - self.assertEqual(codes.count('FAILED'), 4) - self.assertEqual(codes.count('PASSED'), 8) + self.assertEqual(codes.count('FAILED'), 3) + self.assertEqual(codes.count('PASSED'), 9) self.assertEqual(codes.count('SKIPPED'), 0) with self.assertRaises(ValueError): From df4c4b6c5e87235462c94d5ce42f00fc0432c20d Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sun, 9 Jun 2024 18:18:31 -0400 Subject: [PATCH 3/3] s/WCMP 2/WCMP2/g --- README.md | 8 ++++---- pywcmp/ets.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0008827..b7edd5a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ pywcmp provides validation and quality assessment capabilities for the [WMO WIS](https://community.wmo.int/activity-areas/wis/wis-overview) Core Metadata Profile (WCMP). -- validation against [WCMP 2 (draft)](https://github.com/wmo-im/wcmp2), specifically [Annex A: Conformance Class Abstract Test Suite](https://wmo-im.github.io/wcmp2/standard/wcmp2-DRAFT.html#_conformance_class_abstract_test_suite_normative), implementing an executable test suite against the ATS +- validation against [WCMP2 (draft)](https://github.com/wmo-im/wcmp2), specifically [Annex A: Conformance Class Abstract Test Suite](https://wmo-im.github.io/wcmp2/standard/wcmp2-DRAFT.html#_conformance_class_abstract_test_suite_normative), implementing an executable test suite against the ATS - quality assessement against the [WCMP Key Performance Indicators](https://community.wmo.int/activity-areas/wis/wis-metadata-kpis) ## Installation @@ -47,13 +47,13 @@ pywcmp bundle sync # abstract test suite -# validate WCMP 2 metadata against abstract test suite (file on disk) +# validate WCMP2 metadata against abstract test suite (file on disk) pywcmp ets validate /path/to/file.json -# validate WCMP 2 metadata against abstract test suite (URL) +# validate WCMP2 metadata against abstract test suite (URL) pywcmp ets validate https://example.org/path/to/file.json -# validate WCMP 2 metadata against abstract test suite (URL), but turn JSON Schema validation off +# validate WCMP2 metadata against abstract test suite (URL), but turn JSON Schema validation off pywcmp ets validate https://example.org/path/to/file.json --no-fail-on-schema-validation # adjust debugging messages (CRITICAL, ERROR, WARNING, INFO, DEBUG) to stdout diff --git a/pywcmp/ets.py b/pywcmp/ets.py index ea90075..ec04d73 100644 --- a/pywcmp/ets.py +++ b/pywcmp/ets.py @@ -72,7 +72,7 @@ def validate(ctx, file_or_url, logfile, verbosity, raise click.ClickException(err) ctx.exit(1) - click.echo('Detected WCMP 2 discovery metadata') + click.echo('Detected WCMP2 discovery metadata') ts = WMOCoreMetadataProfileTestSuite2(data) try: results = ts.run_tests(fail_on_schema_validation)