Skip to content

Commit

Permalink
corner case for negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewprzh committed Apr 3, 2024
1 parent 5b4143e commit 8a805a6
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions tests/github/run_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,23 @@ def check_value(etalon_value, output_value, name):
lower_bound = etalon_value * 0.99
upper_bound = etalon_value * 1.01
exit_code = 0
if output_value < lower_bound:
log.error("Value of %s = %2.2f is lower than the expected value %2.2f" % (name, output_value, lower_bound))
exit_code = -41
if output_value < 0:
if output_value != etalon_value:
log.error("Value of %s = %2.2f is not equal to value %2.2f" % (name, output_value, lower_bound))
exit_code = -40
else:
log.info("Value of %s = %2.2f == %2.2f as expected" % (name, output_value, upper_bound))
else:
log.info("Value of %s = %2.2f >= %2.2f as expected" % (name, output_value, lower_bound))
if output_value > upper_bound:
log.error("Value of %s = %2.2f is higher than the expected value %2.2f" % (name, output_value, upper_bound))
exit_code = -42
else:
log.info("Value of %s = %2.2f <= %2.2f as expected" % (name, output_value, upper_bound))
if output_value < lower_bound:
log.error("Value of %s = %2.2f is lower than the expected value %2.2f" % (name, output_value, lower_bound))
exit_code = -41
else:
log.info("Value of %s = %2.2f >= %2.2f as expected" % (name, output_value, lower_bound))
if output_value > upper_bound:
log.error("Value of %s = %2.2f is higher than the expected value %2.2f" % (name, output_value, upper_bound))
exit_code = -42
else:
log.info("Value of %s = %2.2f <= %2.2f as expected" % (name, output_value, upper_bound))
return exit_code


Expand Down

0 comments on commit 8a805a6

Please sign in to comment.