Skip to content

Commit

Permalink
Guard against missing class properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-r-thorpe committed Dec 18, 2023
1 parent 088b22e commit af8d55e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nmostesting/suites/IS1201Test.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,14 @@ def check_object_properties(self, test, reference_class_descriptor, oid, context
for class_property in reference_class_descriptor['properties']:
response = self.get_property(test, oid, class_property.get('id'), context)

if response is None:
# Can't find this property - do we have an ID clash
self.device_model_metadata["error"] = True
self.device_model_metadata["error_msg"] += \
"Property does not exist - it is possible that the class id for this class is NOT unique? " \
+ "classId: " + ".".join(map(str, reference_class_descriptor['classId']))
continue

object_property = response["value"]

if class_property["isDeprecated"]:
Expand Down

0 comments on commit af8d55e

Please sign in to comment.