Commit 84a8dbe5 authored by Tristan Cavelier's avatar Tristan Cavelier Committed by Alain Takoudjou

check_apachedex_result: improve output message

test_check_apachedex_result: fix float threshold
parent a70c5fd2
...@@ -38,7 +38,7 @@ def checkApachedexResult(apachedex_path, apachedex_report_status_file, desired_t ...@@ -38,7 +38,7 @@ def checkApachedexResult(apachedex_path, apachedex_report_status_file, desired_t
if apx_result > desired_threshold: if apx_result > desired_threshold:
return 0, "Thanks for keeping it all clean, result is %s" % apx_result return 0, "Thanks for keeping it all clean, result is %s" % apx_result
else: else:
return 1, "Threshold is lower than expected: Expected was %f and current result is %s" % (desired_threshold, apx_result) return 1, "Threshold is lower than expected: Expected was %s and current result is %s" % (desired_threshold, apx_result)
message = "No result found in the apdex file or the file is corrupted" message = "No result found in the apdex file or the file is corrupted"
break break
......
...@@ -82,8 +82,8 @@ class TestCheckApacheDigestResult(unittest.TestCase): ...@@ -82,8 +82,8 @@ class TestCheckApacheDigestResult(unittest.TestCase):
self._create_file(self.today, True) self._create_file(self.today, True)
def test_threshold_is_lower(self): def test_threshold_is_lower(self):
status, message = checkApachedexResult(self.base_dir, self.status_file, 90) status, message = checkApachedexResult(self.base_dir, self.status_file, threshold)
self.assertEquals("Threshold is lower than expected: Expected was 90 and current result is 80", message) self.assertEquals("Threshold is lower than expected: Expected was 90.0 and current result is 80", message)
self.assertEquals(1, status) self.assertEquals(1, status)
def test_no_today_file_but_yesterday_file(self): def test_no_today_file_but_yesterday_file(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment