Index: suite_leahi/tst_solution_infusion/test.py =================================================================== diff -u -r88cc7fe95f2dccaf433dae76aa929a4568795102 -r9eecbb5ba577cea331207beeac5d04e0a0e9bf0a --- suite_leahi/tst_solution_infusion/test.py (.../test.py) (revision 88cc7fe95f2dccaf433dae76aa929a4568795102) +++ suite_leahi/tst_solution_infusion/test.py (.../test.py) (revision 9eecbb5ba577cea331207beeac5d04e0a0e9bf0a) @@ -3,7 +3,7 @@ # Python import os import can - +from configuration import config, utility # plugin specific from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.protocols import CAN @@ -17,7 +17,7 @@ import names -salineBolusStartState = "-1" +salineBolusStartState = None def main(): td_interface = TD_Messaging() @@ -26,14 +26,14 @@ # handle sent messages from UI if can_interface is not None: - channel_id = CAN.DenaliChannels.ui_to_td_ch_id + channel_id = CAN.CanChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_SOLUTION_INFUSION_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_solution_infusion_request) - - startApplication("leahi") + + startApplication(utility.aut("-q")) test.log("Starting leahi") td_interface.td_operation_mode( TDOpModes.MODE_STAN.value, 0 ) @@ -59,11 +59,11 @@ # verify saline text salineTextObj = waitForObject(names.salineDeliveredText) - test.compare(salineTextObj.text, "Total Saline Delivered", "Testing 'Total Saline Delivered' text") + test.compare(salineTextObj.text, config.TOTAL_FLUID_DELIVERED, "Testing 'Total Saline Delivered' text") # verify send start bolus req message mouseClick(waitForObject(names.startFluidButton)) - test.verify(waitFor("'salineBolusStartState == 1'", 5000), "Testing UI -> TD message start bolus") + test.verify(waitFor(lambda: salineBolusStartState == 1, 5000), "Testing UI -> TD message start bolus") # change state to in progress td_interface.td_tx_state( @@ -84,7 +84,7 @@ test.compare(treatmentSaline.isStarted, True, "Testing vTDTreatmentStates.sbRunning") # verify text - test.compare(salineTextObj.text, "Delivering Saline", "Testing Saline Description text") + test.compare(salineTextObj.text, config.DELIVERING_FLUID, "Testing Saline Description text") # verify saline data bolusValueInTest = 75 @@ -105,7 +105,7 @@ # verify send stop bolus req message mouseClick(waitForObject(names.startFluidButton)) - test.verify(waitFor("'salineBolusStartState == 0'", 5000), "Testing UI -> TD message stop bolus") + test.verify(waitFor(lambda: salineBolusStartState == 0, 5000), "Testing UI -> TD message stop bolus") # change state to idle td_interface.td_tx_state( @@ -134,9 +134,5 @@ index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global salineBolusStartState - salineBolusStartState = str(state) - - - - - \ No newline at end of file + salineBolusStartState = state + \ No newline at end of file