X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Ftests%2Funit%2Fbenchmark%2Fcontexts%2Ftest_node.py;h=da16074d9cc3a2e77df03acac388641e2b56766d;hb=abb0dd41a45dd6cbc0f1c0f2831aa2e0b4647566;hp=5d7b24c3d48a0ef56acce351043b41940ddc50a5;hpb=2d6ded8483c7e8edc29bd33a5e519207f1bb511e;p=yardstick.git diff --git a/yardstick/tests/unit/benchmark/contexts/test_node.py b/yardstick/tests/unit/benchmark/contexts/test_node.py index 5d7b24c3d..da16074d9 100644 --- a/yardstick/tests/unit/benchmark/contexts/test_node.py +++ b/yardstick/tests/unit/benchmark/contexts/test_node.py @@ -8,14 +8,16 @@ ############################################################################## import os -import unittest import errno + import mock +import unittest -from yardstick.common import constants as consts from yardstick.benchmark.contexts import base from yardstick.benchmark.contexts import node +from yardstick.common import constants as consts from yardstick.common import exceptions +from yardstick.common import yaml_loader class NodeContextTestCase(unittest.TestCase): @@ -56,7 +58,7 @@ class NodeContextTestCase(unittest.TestCase): self.assertEqual(self.test_context.env, {}) self.assertEqual(self.test_context.attrs, {}) - @mock.patch('yardstick.common.utils.read_yaml_file') + @mock.patch.object(yaml_loader, 'read_yaml_file') @mock.patch('{}.os.path.join'.format(PREFIX)) def test_init_negative(self, mock_path_join, read_mock): special_path = '/foo/bar/error_file' @@ -170,7 +172,7 @@ class NodeContextTestCase(unittest.TestCase): def test__get_physical_nodes(self): self.test_context.init(self.attrs) nodes = self.test_context._get_physical_nodes() - self.assertEquals(nodes, self.test_context.nodes) + self.assertEqual(nodes, self.test_context.nodes) def test__get_physical_node_for_server(self): self.test_context.init(self.attrs) @@ -198,7 +200,7 @@ class NodeContextTestCase(unittest.TestCase): node_collectd_options = [node for node in self.test_context.nodes if node['name'] == 'node1'][0]['collectd'] - self.assertEquals(node_collectd_options, options) + self.assertEqual(node_collectd_options, options) @mock.patch('{}.NodeContext._dispatch_script'.format(PREFIX)) def test_deploy(self, dispatch_script_mock):