From 5930150915999fd410d7a2da38723065bcf7c91f Mon Sep 17 00:00:00 2001 From: mbeierl Date: Wed, 15 Aug 2018 22:29:15 -0400 Subject: Fixing Suprious Exception When the results are too small to calculate the slope, an exception is reported in the logs. This change avoids triggering the exception criteria. Change-Id: Iae886cde6244e9077ff94812bd830c48adaef365 Signed-off-by: mbeierl --- docker/storperf-master/tests/utilities_tests/math_slope_test.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'docker/storperf-master/tests/utilities_tests/math_slope_test.py') diff --git a/docker/storperf-master/tests/utilities_tests/math_slope_test.py b/docker/storperf-master/tests/utilities_tests/math_slope_test.py index 24d5cd7..5c286ad 100644 --- a/docker/storperf-master/tests/utilities_tests/math_slope_test.py +++ b/docker/storperf-master/tests/utilities_tests/math_slope_test.py @@ -21,6 +21,11 @@ class MathSlopeTest(unittest.TestCase): actual = Slope.slope([]) self.assertEqual(expected, actual) + def test_slope_one_series(self): + expected = None + actual = Slope.slope([[1, 0.0]]) + self.assertEqual(expected, actual) + def test_slope_integer_series(self): expected = 1.4 actual = Slope.slope([[1, 6], [2, 5], [3, 7], [4, 10]]) -- cgit 1.2.3-korg