diff --git a/src/ska_tango_base/base/base_device.py b/src/ska_tango_base/base/base_device.py index 683459704ccfda910f3f9dc1c9dfb74eb6dfb839..ef2d9e28a73d2eb1c6d213156b392730a4adacb0 100644 --- a/src/ska_tango_base/base/base_device.py +++ b/src/ska_tango_base/base/base_device.py @@ -1184,7 +1184,7 @@ class SKABaseDevice(Device): @command( dtype_out="DevVarLongStringArray", - doc_out="(ReturnType, 'Command unique ID')", + doc_out="(ResultCode, 'Command unique ID')", ) @DebugIt() def GetVersionInfo(self): @@ -1195,11 +1195,11 @@ class SKABaseDevice(Device): To modify behaviour for this command, modify the do() method of the command class. - :return: Version details of the device. + :return: The result code and the command unique ID """ command = self.get_command_object("GetVersionInfo") - unique_id, return_code = self.component_manager.enqueue(command) - return [[return_code], [unique_id]] + unique_id, result_code = self.component_manager.enqueue(command) + return [[result_code], [unique_id]] # PROTECTED REGION END # // SKABaseDevice.GetVersionInfo class ResetCommand(StateModelCommand, ResponseCommand): diff --git a/src/ska_tango_base/controller_device.py b/src/ska_tango_base/controller_device.py index a440120822f5610d4ed9c699a83ae3122065cd1a..a390d9a15f1e5198295dd8a2fb0c8cf6651d67ee 100644 --- a/src/ska_tango_base/controller_device.py +++ b/src/ska_tango_base/controller_device.py @@ -240,7 +240,8 @@ class SKAController(SKABaseDevice): @command( dtype_in="DevVarLongStringArray", doc_in="[nrInstances][Capability types]", - dtype_out="bool", + dtype_out="DevVarLongStringArray", + doc_out="(ResultCode, 'Command unique ID')", ) @DebugIt() def isCapabilityAchievable(self, argin): @@ -258,11 +259,12 @@ class SKAController(SKABaseDevice): :type argin: :py:class:`tango.DevVarLongStringArray`. - :return: True if capability can be achieved, False if cannot - :rtype: DevBoolean + :return: result_code, unique_id + :rtype: DevVarLongStringArray """ command = self.get_command_object("IsCapabilityAchievable") - return command(argin) + unique_id, result_code = self.component_manager.enqueue(command, argin) + return [[result_code], [unique_id]] # PROTECTED REGION END # // SKAController.isCapabilityAchievable diff --git a/tests/test_controller_device.py b/tests/test_controller_device.py index 8173ddd554e021dd9f784747ce9b5950ce255f5b..981a1d03e7a8269cf95928d54c98c3168f9fa2e1 100644 --- a/tests/test_controller_device.py +++ b/tests/test_controller_device.py @@ -108,7 +108,10 @@ class TestSKAController(object): def test_isCapabilityAchievable_failure(self, device_under_test): """Test for isCapabilityAchievable to test failure condition.""" # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_failure) ENABLED START # - assert device_under_test.isCapabilityAchievable([[2], ["BAND1"]]) is False + device_under_test.isCapabilityAchievable([[2], ["BAND1"]]) + capability_achievalble = device_under_test.longRunningCommandResult[2] + assert capability_achievalble == "False" + # assert device_under_test.isCapabilityAchievable([[2], ["BAND1"]]) is False # PROTECTED REGION END # // SKAController.test_isCapabilityAchievable_failure # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_success_decorators) ENABLED START # @@ -117,7 +120,9 @@ class TestSKAController(object): def test_isCapabilityAchievable_success(self, device_under_test): """Test for isCapabilityAchievable to test success condition.""" # PROTECTED REGION ID(SKAController.test_isCapabilityAchievable_success) ENABLED START # - assert device_under_test.isCapabilityAchievable([[1], ["BAND1"]]) is True + device_under_test.isCapabilityAchievable([[1], ["BAND1"]]) + capability_achievalble = device_under_test.longRunningCommandResult[2] + assert capability_achievalble == "True" # PROTECTED REGION END # // SKAController.test_isCapabilityAchievable_success # PROTECTED REGION ID(SKAController.test_elementLoggerAddress_decorators) ENABLED START #