diff options
author | John O Loughlin <john.oloughlin@intel.com> | 2019-01-18 11:27:03 +0000 |
---|---|---|
committer | Emma Foley <emma.l.foley@intel.com> | 2019-01-31 10:24:43 +0000 |
commit | 5038f9068c70bfe2ef5241c5d88fa14067287daf (patch) | |
tree | d50e1f862be822963c57524f88182eb506b19ee5 /yardstick/tests/unit | |
parent | 51fcd65a47991a62235f32b63c0b4f732551fca5 (diff) |
Fix exception handling ixload
Ixload uses its own version of python
By default it will fail to import yardstick.common exceptions.
For this reason for this reason ixload exceptions should be kept
in http_ixload.py
JIRA: YARDSTICK-1587
Change-Id: I5673fb5b89bbcdf4d3c60c283231d44d770999ec
Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
Diffstat (limited to 'yardstick/tests/unit')
-rw-r--r-- | yardstick/tests/unit/network_services/traffic_profile/test_http_ixload.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_http_ixload.py b/yardstick/tests/unit/network_services/traffic_profile/test_http_ixload.py index c9be200b2..996360c2e 100644 --- a/yardstick/tests/unit/network_services/traffic_profile/test_http_ixload.py +++ b/yardstick/tests/unit/network_services/traffic_profile/test_http_ixload.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 Intel Corporation +# Copyright (c) 2017-2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ import mock from oslo_serialization import jsonutils -from yardstick.common import exceptions from yardstick.network_services.traffic_profile import http_ixload from yardstick.network_services.traffic_profile.http_ixload import \ join_non_strings, validate_non_string_sequence @@ -288,7 +287,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): net_traffic.network.getL1Plugin.return_value = Exception - with self.assertRaises(exceptions.InvalidRxfFile): + with self.assertRaises(http_ixload.InvalidRxfFile): ixload.update_network_mac_address(net_traffic, "auto") def test_update_network_address(self): @@ -312,7 +311,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): net_traffic.network.getL1Plugin.return_value = Exception - with self.assertRaises(exceptions.InvalidRxfFile): + with self.assertRaises(http_ixload.InvalidRxfFile): ixload.update_network_address(net_traffic, "address", "gateway", "prefix") @@ -375,7 +374,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): pageObject="page_object") net_traffic.activityList = [] - with self.assertRaises(exceptions.InvalidRxfFile): + with self.assertRaises(http_ixload.InvalidRxfFile): ixload.update_page_size(net_traffic, "page_object") def test_update_user_count(self): @@ -390,7 +389,7 @@ class TestIxLoadTrafficGen(unittest.TestCase): activity.config.assert_called_once_with(userObjectiveValue=123) net_traffic.activityList = [] - with self.assertRaises(exceptions.InvalidRxfFile): + with self.assertRaises(http_ixload.InvalidRxfFile): ixload.update_user_count(net_traffic, 123) @mock.patch('yardstick.network_services.traffic_profile.http_ixload.IxLoad') |