aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/cli/commands/test_cli_os.py
diff options
context:
space:
mode:
authorJose Lausuch <jose.lausuch@ericsson.com>2017-06-21 08:33:02 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-21 08:33:02 +0000
commit51899de7927bbf6be76639508ae2970046add625 (patch)
treea2cc98e1a98b012e81d82ac8653932c00ea8ba3e /functest/tests/unit/cli/commands/test_cli_os.py
parente7ab53553d719b0fb35b4a74cd0bbc9572c7a48d (diff)
parent997a42438f2253aa9fe640c1cbdd8ea461901948 (diff)
Merge "Remove all references to /home/opnfv/repos/functest"
Diffstat (limited to 'functest/tests/unit/cli/commands/test_cli_os.py')
-rw-r--r--functest/tests/unit/cli/commands/test_cli_os.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/functest/tests/unit/cli/commands/test_cli_os.py b/functest/tests/unit/cli/commands/test_cli_os.py
index c3285ecb..50ebe4b5 100644
--- a/functest/tests/unit/cli/commands/test_cli_os.py
+++ b/functest/tests/unit/cli/commands/test_cli_os.py
@@ -8,13 +8,13 @@
#
import logging
+import pkg_resources
import unittest
import os
import mock
from functest.cli.commands import cli_os
-from functest.utils.constants import CONST
class CliOpenStackTesting(unittest.TestCase):
@@ -25,7 +25,6 @@ class CliOpenStackTesting(unittest.TestCase):
self.installer_type = 'test_installer_type'
self.installer_ip = 'test_installer_ip'
self.openstack_creds = 'test_openstack_creds'
- self.dir_repo_functest = 'test_dir_repo_functest'
self.snapshot_file = 'test_snapshot_file'
self.cli_os = cli_os.CliOpenStack()
@@ -64,11 +63,10 @@ class CliOpenStackTesting(unittest.TestCase):
@mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
def test_check(self, mock_ftutils_execute):
with mock.patch.object(self.cli_os, 'ping_endpoint'):
- CONST.__setattr__('dir_repo_functest', self.dir_repo_functest)
- cmd = os.path.join(CONST.__getattribute__('dir_repo_functest'),
- "functest/ci/check_os.sh")
self.cli_os.check()
- mock_ftutils_execute.assert_called_once_with(cmd, verbose=False)
+ mock_ftutils_execute.assert_called_once_with(
+ "sh %s" % pkg_resources.resource_filename(
+ 'functest', 'ci/check_os.sh'), verbose=False)
@mock.patch('functest.cli.commands.cli_os.os.path.isfile',
return_value=False)