summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2017-01-18 15:04:44 +0530
committerDeepak S <deepak.s@linux.intel.com>2017-01-19 02:17:56 +0530
commitb56008ed0978632063f6dd9653f9d7a2070e2727 (patch)
treee71a4080378f36473f18e6a0154d0a9984a572d5 /tests/unit/benchmark
parentea706beda50f87ae37799bd8f0313d177909a4ff (diff)
Re-factor Node.py to use better python inbuilt functions
1. don't use sys.exit() to exit when there is an exception, it will hide the underlying error 2. use the Abstract Base Classes for type checking. 3. don't have to build list, can use next JIRA: YARDSTICK-541 Change-Id: Id4485acb21e7e02bbc22d3e689cbf0699363098a Signed-off-by: Deepak S <deepak.s@linux.intel.com>
Diffstat (limited to 'tests/unit/benchmark')
-rw-r--r--tests/unit/benchmark/contexts/test_node.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/benchmark/contexts/test_node.py b/tests/unit/benchmark/contexts/test_node.py
index de5ba7066..64fe4a566 100644
--- a/tests/unit/benchmark/contexts/test_node.py
+++ b/tests/unit/benchmark/contexts/test_node.py
@@ -42,7 +42,7 @@ class NodeContextTestCase(unittest.TestCase):
'file': self._get_file_abspath("error_file")
}
- self.assertRaises(SystemExit, self.test_context.init, attrs)
+ self.assertRaises(IOError, self.test_context.init, attrs)
def test_successful_init(self):
@@ -100,7 +100,7 @@ class NodeContextTestCase(unittest.TestCase):
attr_name = 'node1.foo'
- self.assertRaises(SystemExit, self.test_context._get_server, attr_name)
+ self.assertRaises(ValueError, self.test_context._get_server, attr_name)
def test__get_server_found(self):