aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/cli/commands/test_cli_env.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_env.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_env.py')
-rw-r--r--functest/tests/unit/cli/commands/test_cli_env.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/functest/tests/unit/cli/commands/test_cli_env.py b/functest/tests/unit/cli/commands/test_cli_env.py
index b4e98787..0b18554b 100644
--- a/functest/tests/unit/cli/commands/test_cli_env.py
+++ b/functest/tests/unit/cli/commands/test_cli_env.py
@@ -6,6 +6,7 @@
# http://www.apache.org/licenses/LICENSE-2.0
import logging
+import pkg_resources
import unittest
import mock
@@ -24,8 +25,8 @@ class CliEnvTesting(unittest.TestCase):
return_value=False)
@mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command')
def test_prepare_default(self, mock_ft_utils, mock_os):
- cmd = ("python %s/functest/ci/prepare_env.py start" %
- CONST.__getattribute__('dir_repo_functest'))
+ cmd = ("python %s start" % pkg_resources.resource_filename(
+ 'functest', 'ci/prepare_env.py'))
self.cli_environ.prepare()
mock_ft_utils.assert_called_with(cmd)
@@ -36,8 +37,8 @@ class CliEnvTesting(unittest.TestCase):
with mock.patch('__builtin__.raw_input', return_value="y"), \
mock.patch('functest.cli.commands.cli_testcase.os.remove') \
as mock_os_remove:
- cmd = ("python %s/functest/ci/prepare_env.py start" %
- CONST.__getattribute__('dir_repo_functest'))
+ cmd = ("python %s start" % pkg_resources.resource_filename(
+ 'functest', 'ci/prepare_env.py'))
self.cli_environ.prepare()
mock_os_remove.assert_called_once_with(
CONST.__getattribute__('env_active'))