From 997a42438f2253aa9fe640c1cbdd8ea461901948 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sun, 18 Jun 2017 23:43:51 +0200 Subject: Remove all references to /home/opnfv/repos/functest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- functest/tests/unit/cli/commands/test_cli_os.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'functest/tests/unit/cli/commands/test_cli_os.py') diff --git a/functest/tests/unit/cli/commands/test_cli_os.py b/functest/tests/unit/cli/commands/test_cli_os.py index c3285ecbe..50ebe4b5d 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) -- cgit 1.2.3-korg