From 12a77b94ca82d8c39107a0c48205a67d2aad341d Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Fri, 3 Nov 2023 08:29:26 +0100 Subject: [PATCH] TEST: get_deep with inheritance --- unittests/test_json_schema_exporter.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/unittests/test_json_schema_exporter.py b/unittests/test_json_schema_exporter.py index edb5c4e1..b182f576 100644 --- a/unittests/test_json_schema_exporter.py +++ b/unittests/test_json_schema_exporter.py @@ -723,3 +723,21 @@ RT2: array = jsex.make_array(schema_RT1) assert array["type"] == "array" assert array["items"] == schema_RT1 + + +def test_inheritance(): + """Test data models with inherited properties.""" + model_str = """ +some_date: + datatype: DATETIME +RT1: + obligatory_properties: + some_date: +RT2: + inherit_from_suggested: + - RT1 + """ + model = parse_model_from_string(model_str) + rt2_deep = model.get_deep("RT2") + + assert "some_date" in [prop.name for prop in rt2_deep.properties] -- GitLab