Index: tst_TreatmentSalineData/test.py =================================================================== diff -u -r9fc49dcb5999a8def502d0a0984b35b9e67a8092 -r2dc140932c71c9b21e2c60410ec0ca58e04d9771 --- tst_TreatmentSalineData/test.py (.../test.py) (revision 9fc49dcb5999a8def502d0a0984b35b9e67a8092) +++ tst_TreatmentSalineData/test.py (.../test.py) (revision 2dc140932c71c9b21e2c60410ec0ca58e04d9771) @@ -29,6 +29,7 @@ def getUnit(): global saline_unit saline_unit = str(waitForObjectExists(names.o_treatmentStart_SalineSection).unit) + def gotoScreenNtest_Contains_TreatmentSalineBolusData(): mouseClick(waitForObject(names.o_treatmentHome_startTreatment)) @@ -37,16 +38,18 @@ test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).visible , True) -def test_values(vTarget, vCumulative, vDelivered): - test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueTarget , vTarget ) +def test_values(vCumulative, vDelivered): test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueCumulative, vCumulative) test.compare(waitForObjectExists(names.o_treatmentStart_SalineSection).valueDelivered , vDelivered ) - test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineTarget ).text), "({:.0f} {})".format(vTarget, saline_unit)) test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineCumulative).text), "{:.0f}".format(vCumulative)) test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineDelivered ).text), "{:.0f}".format(vDelivered )) +def test_target(vTarget): + test.compare( waitForObjectExists(names.o_treatmentStart_SalineSection).valueTarget , vTarget ) + test.compare(str(waitForObjectExists(names.o_treatmentStart_SalineTarget ).text) , "({:.0f} {})".format(vTarget, saline_unit)) + def main(): utils.tstStart(__file__) @@ -61,9 +64,24 @@ cumulitive = 0 step = 1 for target in [100, 200, 300]: + denaliMessages.setTreatmentSalineBolusData(target, 0, 0) + test_target(target) for value in range ( 0, target, step): cumulitive += step denaliMessages.setTreatmentSalineBolusData(target, cumulitive, value+1) # 0 is not a step - test_values (target, cumulitive, value+1) # 0 is not a step + test_values ( cumulitive, value+1) # 0 is not a step + + denaliMessages.setTreatmentSalineBolusData(200, 110, 10) + test_target (200 ) + test_values ( 110, 10) + denaliMessages.setTreatmentSalineBolusData(200, 110, 10) + test_target (200 ) + test_values ( 110, 10) + + denaliMessages.setTreatmentSalineBolusData( 0, 0, 0) + test_target ( 0 ) + test_values ( 0, 0) + + utils.tstDone()