diff --git a/integrationtests/test_yaml_parser.py b/integrationtests/test_yaml_parser.py index 5401367cdea643cd98dbfcc38b51a2cd56067a87..e2a2c4c056ced56d2605d93914186c2cba97e137 100644 --- a/integrationtests/test_yaml_parser.py +++ b/integrationtests/test_yaml_parser.py @@ -37,7 +37,7 @@ def teardown_module(): _delete_everything() -def test_name_in_extern(): +def test_internal_props_in_extern(): """Test adding the internal `name` property as a parent to an existing property. @@ -47,15 +47,23 @@ def test_name_in_extern(): extern: - name - test_name +- description +- unit test_name: inherit_from_suggested: - name + - description + - unit """ db.Property(name="test_name", datatype=db.TEXT).insert() ents = parse_model_from_string(model) ents.sync_data_model(noquestion=True) test_prop = db.Property(name="test_name").retrieve() + assert len(test_prop.parents) == 3 + desc_prop = db.Property(name="description").retrieve() name_prop = db.Property(name="name").retrieve() - assert len(test_prop.parents) == 1 + unit_prop = db.Property(name="unit").retrieve() + assert test_prop.has_parent(desc_prop) assert test_prop.has_parent(name_prop) + assert test_prop.has_parent(unit_prop) diff --git a/src/caosadvancedtools/models/data_model.py b/src/caosadvancedtools/models/data_model.py index 47ca5f1eefe6d057fbc004dcad9af89c75f1a300..e035158d5d7c2492168393d3b99f2ea380657f5c 100644 --- a/src/caosadvancedtools/models/data_model.py +++ b/src/caosadvancedtools/models/data_model.py @@ -34,6 +34,7 @@ from caosdb.apiutils import compare_entities, describe_diff CAOSDB_INTERNAL_PROPERTIES = [ + "description", "name", "unit", ]