Skip to content

Commit

Permalink
Add testing of enum ans struct sequences
Browse files Browse the repository at this point in the history
Refactor error message handling
  • Loading branch information
jonathan-r-thorpe committed Oct 11, 2024
1 parent d96d424 commit d276ec4
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 61 deletions.
13 changes: 8 additions & 5 deletions nmostesting/MS05Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,13 @@ def generate_device_model_datatype_schemas(self, test):
# This will include any Non-standard data types
class_manager = self.get_class_manager(test)

# Create JSON schemas for the queried datatypes
return self.generate_json_schemas(
datatype_descriptors=class_manager.datatype_descriptors,
schema_path=os.path.join(self.apis[self.protocol_api_key]["spec_path"], 'APIs/tmp_schemas/'))
try:
# Create JSON schemas for the queried datatypes
return self.generate_json_schemas(
datatype_descriptors=class_manager.datatype_descriptors,
schema_path=os.path.join(self.apis[self.protocol_api_key]["spec_path"], 'APIs/tmp_schemas/'))
except Exception as e:
raise NMOSTestException(test.FAIL(f"Unable to create Device Model schemas: {e.message}"))

def validate_reference_datatype_schema(self, test, payload, datatype_name, context=""):
"""Validate payload against reference datatype schema"""
Expand Down Expand Up @@ -477,7 +480,7 @@ def is_non_standard_class(self, class_id):
def is_manager(self, class_id):
""" Check class id to determine if this is a manager """
return len(class_id) > 1 and class_id[0] == 1 and class_id[1] == 3

def is_block(self, class_id):
""" Check class id to determine if this is a block """
return len(class_id) > 1 and class_id[0] == 1 and class_id[1] == 1
Expand Down
Loading

0 comments on commit d276ec4

Please sign in to comment.