Index: tst_Treatment_Adjustment_Ultrafiltration/test.py =================================================================== diff -u -r24485172848ae32d15cf665b2ef024129dec6ca2 -r93fe289e1e33e4b2cf824e30f810490f073ecab3 --- tst_Treatment_Adjustment_Ultrafiltration/test.py (.../test.py) (revision 24485172848ae32d15cf665b2ef024129dec6ca2) +++ tst_Treatment_Adjustment_Ultrafiltration/test.py (.../test.py) (revision 93fe289e1e33e4b2cf824e30f810490f073ecab3) @@ -13,8 +13,8 @@ # import names -from dialin.squish import utils, denaliMessages -from dialin.squish.denaliMessages import txStates +from dialin.ui import utils, hd_simulator +from dialin.ui.hd_simulator import txStates from dialin.common.msg_defs import RequestRejectReasons as rejectReason @@ -61,7 +61,7 @@ def startNTestTreatmentUltrafiltration(vMinUF, vMaxUF): for i in range(vMinUF, vMaxUF+1, 10): - denaliMessages.setTreatmentUltrafiltration(vMaxUF, i, 1, 1, 1, 1, 1) + hd_simulator.setTreatmentUltrafiltration(vMaxUF, i, 1, 1, 1, 1, 1) test.compare(utils.l2ml(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), i) @@ -105,14 +105,14 @@ # [Normal Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationStart_NotificationBar).text), "") # [Reject Pause] - denaliMessages.setTreatmentAdjustUltrafiltrationRejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS.value, txStates.UF_RUNNING_STATE) + hd_simulator.setTreatmentAdjustUltrafiltrationRejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS.value, txStates.UF_RUNNING_STATE) # [Reject Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationStart_NotificationBar).text), rejectReason.REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS.name) def pause_Accept(): # [Accept Pause] - denaliMessages.setTreatmentAdjustUltrafiltrationAccepted(txStates.UF_PAUSED_STATE) + hd_simulator.setTreatmentAdjustUltrafiltrationAccepted(txStates.UF_PAUSED_STATE) # [Accept Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), "") utils.waitForGUI(1) @@ -139,14 +139,14 @@ # [Normal Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), "") # [Reject Resume] - denaliMessages.setTreatmentAdjustUltrafiltrationRejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_PAUSED.value, txStates.UF_PAUSED_STATE) + hd_simulator.setTreatmentAdjustUltrafiltrationRejected(rejectReason.REQUEST_REJECT_REASON_UF_NOT_PAUSED.value, txStates.UF_PAUSED_STATE) # [Reject Notification] test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationPaused_NotificationBar).text), rejectReason.REQUEST_REJECT_REASON_UF_NOT_PAUSED.name) def resume_Accept(): # [Accept Resume] - denaliMessages.setTreatmentAdjustUltrafiltrationAccepted(txStates.UF_RUNNING_STATE) + hd_simulator.setTreatmentAdjustUltrafiltrationAccepted(txStates.UF_RUNNING_STATE) utils.waitForGUI(1) @@ -177,15 +177,15 @@ def edit_RejectNTest(): - denaliMessages.setTreatmentAdjustUltrafiltrationEditRejected(rejectReason.REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE.value) + hd_simulator.setTreatmentAdjustUltrafiltrationEditRejected(rejectReason.REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE.value) test.compare( waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar).visible, True) #this error message needs to be changed later when translated. test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_NotificationBar).text), rejectReason.REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE.name) def updateNTest_Adjustment_Ranges(vMinUFVolume, vMaxUFVolume): # HD sends Ultrafiltration ranges - denaliMessages.setTreatmentParamRanges(0, 0, vMinUFVolume, vMaxUFVolume, 0, 0) + hd_simulator.setTreatmentParamRanges(0, 0, vMinUFVolume, vMaxUFVolume, 0, 0) # Edit Screen updates Ultrafiltration ranges on Slider upon Receiving Ranges test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider).minText.text), "{:.3f}".format(utils.ml2l(vMinUFVolume))) test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationEdit_VolumeSlider).maxText.text), "{:.3f}".format(utils.ml2l(vMaxUFVolume))) @@ -201,7 +201,7 @@ def adjustmentResponse(): - denaliMessages.setTreatmentAdjustUltrafiltrationEditResponse(_Accepted, _Reason, _Volume, _Duration, _DurationDiff, _Rate, _RateDiff, _RateOld) + hd_simulator.setTreatmentAdjustUltrafiltrationEditResponse(_Accepted, _Reason, _Volume, _Duration, _DurationDiff, _Rate, _RateDiff, _RateOld) def next_Accepted(vVolume, vRateState, vDurationState): @@ -319,19 +319,19 @@ def confirm_RejectNTest(): - denaliMessages.setTreatmentAdjustUltrafiltrationConfirmRejected(rejectReason.REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM.value) + hd_simulator.setTreatmentAdjustUltrafiltrationConfirmRejected(rejectReason.REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM.value) test.compare( waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).visible, True) test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).text ), rejectReason.REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM.name) def confirm_RejectNTest_Unknow(): - denaliMessages.setTreatmentAdjustUltrafiltrationConfirmRejected(200) + hd_simulator.setTreatmentAdjustUltrafiltrationConfirmRejected(200) test.compare( waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).visible, True) test.compare(str(waitForObjectExists(names.o_treatmentAdjustmentUltrafiltrationConfirm_NotificationBar).text ), "[200] Unknown Error") def confirm_Accept(vVolume, vDuration, vRate): - denaliMessages.setTreatmentAdjustUltrafiltrationConfirmResponse(1, 0, vVolume, vDuration, vRate) + hd_simulator.setTreatmentAdjustUltrafiltrationConfirmResponse(1, 0, vVolume, vDuration, vRate) def main(): @@ -353,7 +353,7 @@ closeScreen() # Back to main # set the ultrafiltration to running state - denaliMessages.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_RUNNING_STATE, txStates.SALINE_BOLUS_STATE_IDLE ) + hd_simulator.setTreatmentStatesData(txStates.TREATMENT_DIALYSIS_STATE_NOT, txStates.UF_RUNNING_STATE, txStates.SALINE_BOLUS_STATE_IDLE) gotoScreen_UltrafiltrationAdjustment()