aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/cli/commands/test_cli_os.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-06-18 23:43:51 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2017-06-20 15:12:04 +0200
commit997a42438f2253aa9fe640c1cbdd8ea461901948 (patch)
tree2c72fe095e3770282547635b4ce387b9a2dae571 /functest/tests/unit/cli/commands/test_cli_os.py
parent0914c7e7011b7ba3ed9eeae7f6c3605afb711640 (diff)
Remove all references to /home/opnfv/repos/functest
It also removes relative (and incomplete) references which could be defined in modules instead of this global configuration. Change-Id: Ie20dc3547e49b6224aa8100cd380d37b87ece5a9 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
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)