From 9b4c04565cc3a61ac1ed2a2b4de9d5a00bc2ceae Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 18 Feb 2022 13:45:53 +0100 Subject: make "uuid" an optional property --- src/hydrilla/builder/build.py | 7 ++++--- src/hydrilla/schemas | 2 +- src/test/source-package-example | 2 +- src/test/test_hydrilla_builder.py | 8 ++++++++ 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/hydrilla/builder/build.py b/src/hydrilla/builder/build.py index 58fe1b2..2824e9b 100644 --- a/src/hydrilla/builder/build.py +++ b/src/hydrilla/builder/build.py @@ -253,9 +253,10 @@ class Build: Return a minimal item reference suitable for using in source description. """ - copy_props = ['type', 'identifier', 'long_name', 'uuid', 'description'] - if 'comment' in item_def: - copy_props.append('comment') + copy_props = ['type', 'identifier', 'long_name', 'description'] + for prop in ('comment', 'uuid'): + if prop in item_def: + copy_props.append(prop) if item_def['type'] == 'resource': item_list = self.resource_list diff --git a/src/hydrilla/schemas b/src/hydrilla/schemas index 1d1c93d..5ef63e8 160000 --- a/src/hydrilla/schemas +++ b/src/hydrilla/schemas @@ -1 +1 @@ -Subproject commit 1d1c93d5a9011ecdf58a4952afcb5a1faff30e76 +Subproject commit 5ef63e81ddd7299bfb738cae643bc48560b68a17 diff --git a/src/test/source-package-example b/src/test/source-package-example index 48606f2..92a4d31 160000 --- a/src/test/source-package-example +++ b/src/test/source-package-example @@ -1 +1 @@ -Subproject commit 48606f288c89aaadb28a021ab71945e1e87fd14e +Subproject commit 92a4d31c659b2336e5e188877d1ce6bfad2fa310 diff --git a/src/test/test_hydrilla_builder.py b/src/test/test_hydrilla_builder.py index c8d29f1..93392db 100644 --- a/src/test/test_hydrilla_builder.py +++ b/src/test/test_hydrilla_builder.py @@ -273,6 +273,14 @@ def modify_index_good(settings: CaseSettings, obj: dict) -> None: settings.expected_mapping['payloads'] = {} + # Don't use UUIDs (they are optional) + for definition in obj['definitions']: + del definition['uuid'] + + for description in settings.expected(): + if 'uuid' in description: + del description['uuid'] + # Add some unrecognized properties that should be stripped to_process = [obj] while to_process: -- cgit v1.2.3