diff options
Diffstat (limited to 'tests/unit/network_services/test_utils.py')
-rw-r--r-- | tests/unit/network_services/test_utils.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/unit/network_services/test_utils.py b/tests/unit/network_services/test_utils.py index ecacac7c3..8d9e74adf 100644 --- a/tests/unit/network_services/test_utils.py +++ b/tests/unit/network_services/test_utils.py @@ -16,6 +16,8 @@ # Unittest for yardstick.network_services.utils from __future__ import absolute_import + +import os import unittest import mock @@ -25,19 +27,24 @@ from yardstick.network_services import utils class UtilsTestCase(unittest.TestCase): """Test all VNF helper methods.""" - DPDK_PATH = "/opt/nsb_bin/dpdk_nic_bind.py" + DPDK_PATH = os.path.join(utils.NSB_ROOT, "dpdk_nic_bind.py") def setUp(self): super(UtilsTestCase, self).setUp() def test_get_nsb_options(self): result = utils.get_nsb_option("bin_path", None) - self.assertEqual(result, "/opt/nsb_bin") + self.assertEqual(result, utils.NSB_ROOT) - def test_get_nsb_optionsi_invalid_key(self): + def test_get_nsb_option_is_invalid_key(self): result = utils.get_nsb_option("bin", None) self.assertEqual(result, None) + def test_get_nsb_option_default(self): + default = object() + result = utils.get_nsb_option("nosuch", default) + self.assertIs(result, default) + def test_provision_tool(self): with mock.patch("yardstick.ssh.SSH") as ssh: ssh_mock = mock.Mock(autospec=ssh.SSH) |