Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r993645b00fe6db65799c8d8c93bfd2b864cb2d37 -rdd182e384d5248240f343cc4855ff292ba5e4ee3 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 993645b00fe6db65799c8d8c93bfd2b864cb2d37) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision dd182e384d5248240f343cc4855ff292ba5e4ee3) @@ -199,6 +199,12 @@ squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, 200, squish.Qt.NoModifier) 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'): + + date = datetime.now() + return str(date.strftime(date_format)) def enter_keypad_value(entry): """ @@ -299,8 +305,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: @@ -346,32 +351,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() def set_venous_ranges_max_val(ven_high): @@ -393,26 +393,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: @@ -444,36 +440,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() def scroll_to_value_on_pop_up(value=None, container=None):