summaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py
diff options
context:
space:
mode:
authorMiikka Koistinen <miikka.koistinen@nokia.com>2018-06-08 13:54:48 +0300
committerEmma Foley <emma.l.foley@intel.com>2018-06-28 11:26:39 +0100
commiteaebb40c960284d7d4ce9ad6221cba32c04a2827 (patch)
tree083aef2a3eaa90981665a0947255dd3e20fdb1b6 /yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py
parent441d5f55a6e2e155d01d4b396678d0d09bfb8413 (diff)
Convert SLA asserts to raises
This commit converts Python assertions to a custom exception in all places where SLA validation is checked with an assertion. This commit also fixes all emerged pylint errors. JIRA: YARDSTICK-966 Change-Id: If771ed03b2cbc0a43a57fcfb9293f18740b3ff80 Signed-off-by: Miikka Koistinen <miikka.koistinen@nokia.com> (cherry picked from 39f80e9b06395ae1515cfcf08508504ad4dd978a)
Diffstat (limited to 'yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py')
-rwxr-xr-xyardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py b/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py
index 5907562c2..a7abcd98a 100755
--- a/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py
+++ b/yardstick/tests/unit/benchmark/scenarios/networking/test_netperf.py
@@ -18,6 +18,7 @@ import mock
from oslo_serialization import jsonutils
from yardstick.benchmark.scenarios.networking import netperf
+from yardstick.common import exceptions as y_exc
@mock.patch('yardstick.benchmark.scenarios.networking.netperf.ssh')
@@ -98,7 +99,7 @@ class NetperfTestCase(unittest.TestCase):
sample_output = self._read_sample_output()
mock_ssh.SSH.from_node().execute.return_value = (0, sample_output, '')
- self.assertRaises(AssertionError, p.run, result)
+ self.assertRaises(y_exc.SLAValidationError, p.run, result)
def test_netperf_unsuccessful_script_error(self, mock_ssh):