Skip to content

Commit

Permalink
Add invoke method utility function.
Browse files Browse the repository at this point in the history
Added MS0502Test and IS1402Test
  • Loading branch information
jonathan-r-thorpe committed May 3, 2024
1 parent 80dedb0 commit 36cec82
Show file tree
Hide file tree
Showing 8 changed files with 1,016 additions and 886 deletions.
10 changes: 8 additions & 2 deletions nmostesting/IS12Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ def set_property(self, test, property_id, argument, oid, **kwargs):
NcObjectMethods.GENERIC_SET.value,
{'id': property_id, 'value': argument})

def invoke_method(self, test, method_id, argument, oid, **kwargs):
"""Invoke method on Node. Raises NMOSTestException on error"""
return self.execute_command(test, oid,
method_id,
{"argument": argument})

def get_sequence_item(self, test, property_id, index, oid, **kwargs):
"""Get value from sequence property. Raises NMOSTestException on error"""
return self.execute_command(test, oid,
Expand All @@ -257,13 +263,13 @@ def set_sequence_item(self, test, property_id, index, value, oid, **kwargs):
NcObjectMethods.SET_SEQUENCE_ITEM.value,
{'id': property_id, 'index': index, 'value': value})

def add_sequence_item(self, test, oid, property_id, value):
def add_sequence_item(self, test, property_id, value, oid, **kwargs):
"""Add value to a sequence property. Raises NMOSTestException on error"""
return self.execute_command(test, oid,
NcObjectMethods.ADD_SEQUENCE_ITEM.value,
{'id': property_id, 'value': value})

def remove_sequence_item(self, test, oid, property_id, index):
def remove_sequence_item(self, test, property_id, index, oid, **kwargs):
"""Get value from sequence property. Raises NMOSTestException on error"""
return self.execute_command(test, oid,
NcObjectMethods.REMOVE_SEQUENCE_ITEM.value,
Expand Down
5 changes: 5 additions & 0 deletions nmostesting/IS14Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ def set_property(self, test, property_id, argument, role_path, **kwargs):
property_value_endpoint = self._create_property_value_endpoint(role_path, property_id)
return self._do_request(test, "SET", property_value_endpoint, data={"value": argument})

def invoke_method(self, test, method_id, argument, role_path, **kwargs):
"""Invoke method on Node. Raises NMOSTestException on error"""
methods_endpoint = self._create_methods_endpoint(role_path, method_id)
return self._do_request(test, "PATCH", methods_endpoint, data={"argument": argument})

def get_sequence_item(self, test, property_id, index, role_path, **kwargs):
"""Get value from sequence property. Raises NMOSTestException on error"""
methods_endpoint = self._create_methods_endpoint(role_path, NcObjectMethods.GET_SEQUENCE_ITEM.value)
Expand Down
8 changes: 8 additions & 0 deletions nmostesting/MS05Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ def get_property_value(self, test, property_id, **kwargs):
def set_property(self, test, property_id, argument, **kwargs):
pass

def invoke_method(self, test, method_id, argument, **kwargs):
pass

def get_sequence_item(self, test, property_id, index, **kwargs):
pass

Expand Down Expand Up @@ -473,6 +476,11 @@ def resolve_datatype(self, test, datatype):
return self.resolve_datatype(test, class_manager.datatype_descriptors[datatype].get("parentType"))
return datatype

def create_role_path(self, base_role_path, role):
role_path = base_role_path.copy()
role_path.append(role)
return role_path


class NcMethodStatus(IntEnum):
OK = 200
Expand Down
24 changes: 24 additions & 0 deletions nmostesting/NMOSTesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
from .suites import IS1201Test
from .suites import IS1202Test
from .suites import IS1401Test
from .suites import IS1402Test
from .suites import BCP00301Test
from .suites import BCP0060101Test
from .suites import BCP0060102Test
Expand Down Expand Up @@ -410,6 +411,29 @@
}],
"class": IS1401Test.IS1401Test
},
"IS-14-02": {
"name": "IS-14 Invasive Testing",
"specs": [{
"spec_key": "is-04",
"api_key": "node"
}, {
"spec_key": "is-14",
"api_key": "configuration"
}, {
"spec_key": "ms-05-02",
"api_key": "controlframework",
"disable_fields": ["host", "port"]
}, {
"spec_key": "controller-tests",
"api_key": "testquestion",
"disable_fields": [] if CONFIG.IS12_INTERACTIVE_TESTING else ["host", "port", "urlpath"]
}],
"extra_specs": [{
"spec_key": "nmos-control-feature-sets",
"api_key": "featuresets"
}],
"class": IS1402Test.IS1402Test
},
"BCP-003-01": {
"name": "BCP-003-01 Secure Communication",
"specs": [{
Expand Down
Loading

0 comments on commit 36cec82

Please sign in to comment.