From 2bdda85878ed1507d1a91f69c3489bb9ba9d447d Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Fri, 1 Jun 2018 13:49:38 +0100 Subject: Move ErrorClass definition to exceptions module JIRA: YARDSTICK-1216 Change-Id: I82556e1d1b0c723221a58e188067cbce560b8338 Signed-off-by: Rodolfo Alonso Hernandez --- yardstick/tests/unit/common/test_exceptions.py | 28 ++++++++++++++++++++++++++ yardstick/tests/unit/common/test_utils.py | 8 -------- 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 yardstick/tests/unit/common/test_exceptions.py (limited to 'yardstick/tests/unit') diff --git a/yardstick/tests/unit/common/test_exceptions.py b/yardstick/tests/unit/common/test_exceptions.py new file mode 100644 index 000000000..884015536 --- /dev/null +++ b/yardstick/tests/unit/common/test_exceptions.py @@ -0,0 +1,28 @@ +# Copyright 2018 Intel Corporation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from yardstick.common import exceptions +from yardstick.tests.unit import base as ut_base + + +class ErrorClassTestCase(ut_base.BaseUnitTestCase): + + def test_init(self): + with self.assertRaises(RuntimeError): + exceptions.ErrorClass() + + def test_getattr(self): + error_instance = exceptions.ErrorClass(test='') + with self.assertRaises(AttributeError): + error_instance.get_name() diff --git a/yardstick/tests/unit/common/test_utils.py b/yardstick/tests/unit/common/test_utils.py index 666b29b5f..b6d7bf5a3 100644 --- a/yardstick/tests/unit/common/test_utils.py +++ b/yardstick/tests/unit/common/test_utils.py @@ -989,14 +989,6 @@ class TestUtils(unittest.TestCase): with self.assertRaises(RuntimeError): utils.validate_non_string_sequence(1, raise_exc=RuntimeError) - def test_error_class(self): - with self.assertRaises(RuntimeError): - yardstick.error.ErrorClass() - - error_instance = yardstick.error.ErrorClass(test='') - with self.assertRaises(AttributeError): - error_instance.get_name() - class TestUtilsIpAddrMethods(unittest.TestCase): -- cgit 1.2.3-korg