Index: shared/scripts/configuration/utility.py =================================================================== diff -u -ra1d91d52c638b1b6291be26a26b346b90cee6bd4 -r2545702a9c0d155e36e6243ccad37b68d71c769e --- shared/scripts/configuration/utility.py (.../utility.py) (revision a1d91d52c638b1b6291be26a26b346b90cee6bd4) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 2545702a9c0d155e36e6243ccad37b68d71c769e) @@ -12,11 +12,11 @@ # ############################################################################ +import object import names -import sys -import test import squish -import object +import test + from configuration import config from dialin.ui import utils from builtins import int as pyInt @@ -69,11 +69,9 @@ ScreenObj = squish.waitForObject(screen_object) screenHeight = pyInt(ScreenObj.height) screenWidth = pyInt(ScreenObj.width) - squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, squish.Qt.NoModifier) + squish.mouseWheel(ScreenObj, screenWidth-1000, screenHeight-10, 0, -50, squish.Qt.NoModifier) - raise LookupError("zone object is not in view to the user after " + \ - "trying 100 times") + raise LookupError("zone object is not in view to the user after trying 100 times") def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): @@ -154,8 +152,7 @@ arterial_min += 10 # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(low_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(low_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) break else: @@ -166,8 +163,7 @@ arterial_min -= 10 # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg if arterial_min == arterial_max - config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(low_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(low_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Arterial range minimum value cannot be moved beyond {}".format(arterial_min)) break else: @@ -203,32 +199,27 @@ arterial_max += 10 # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(high_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) break else: continue elif arterial_max > art_high: while arterial_max != art_high: - squish.mouseDrag(high_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) arterial_max -= 10 # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(high_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) break else: continue # arterial blood pressure low limit should be lower than the high limit by at least 30mmHg if arterial_max == arterial_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - test.compare(high_handler_parent.maxValue, arterial_max, - "Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) + test.compare(high_handler_parent.maxValue, arterial_max, "Arterial range maximum value cannot be moved beyond {}".format(arterial_max)) else: - test.compare(arterial_max, art_high, - "Actual Arterial range maximum value: {} is equal to Expected value: {}".format(arterial_max, art_high)) + test.compare(arterial_max, art_high, "Actual Arterial range maximum value: {} is equal to Expected value: {}".format(arterial_max, art_high)) test.endSection() @@ -252,26 +243,22 @@ test.passes("Venous range maximum is already set to {}".format(ven_high)) elif ven_max < ven_high: while ven_max != ven_high: - squish.mouseDrag(high_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) ven_max += 10 # venous blood pressure low limit should be lower than the high limit by at least 30mmHg if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(high_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) break else: continue elif ven_max > ven_high: while ven_max != ven_high: - squish.mouseDrag(high_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) ven_max -= 10 # venous blood pressure low limit should be lower than the high limit by at least 30mmHg if ven_max == ven_min + config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(high_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(high_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Venous range maximum value cannot be moved beyond {}".format(ven_max)) break else: @@ -303,36 +290,30 @@ test.passes("Venous range minimum is already set to {}".format(ven_low)) elif ven_min < ven_low: while ven_min != ven_low: - squish.mouseDrag(low_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(low_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) ven_min += 10 if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: # venous blood pressure low limit should be lower than the high limit by at least 30mmHg - squish.mouseDrag(low_handler, width, height, 1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(low_handler, width, height, 1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Venous range minimum value cannot be moved beyond {}".format(ven_min)) break else: continue elif ven_min > ven_low: while ven_min != ven_low: - squish.mouseDrag(low_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(low_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) ven_min -= 10 # venous blood pressure low limit should be lower than the high limit by at least 30mmHg if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: - squish.mouseDrag(low_handler, width, height, -1, 0, - squish.Qt.NoModifier, squish.Qt.LeftButton) + squish.mouseDrag(low_handler, width, height, -1, 0, squish.Qt.NoModifier, squish.Qt.LeftButton) test.log("Venous range minimum value cannot be moved beyond {}".format(ven_min)) break else: continue # venous blood pressure low limit should be lower than the high limit by at least 30mmHg if ven_min == ven_max - config.BUFFER_LOW_AND_HIGH_LIMITS: - test.compare(low_handler_parent.minValue, ven_min, - "Venous range minimum value cannot be moved beyond {}".format(ven_min)) + test.compare(low_handler_parent.minValue, ven_min, "Venous range minimum value cannot be moved beyond {}".format(ven_min)) else: - test.compare(ven_min, ven_low, - "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) + test.compare(ven_min, ven_low, "Actual Venous range minimum value: {} is equal to Expected value: {}".format(ven_min, ven_low)) test.endSection()