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-06 13:36:06 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-06-06 13:36:06 +0000
commit6c6b03b310cf60b251a52127901431f7d059e45f (patch)
treea0af3097253a14de0052266e45adaa73b0c752d6 /functest/tests/unit/cli/commands/test_cli_os.py
parent5e9320777016b10685b7edeecfd2b6d0f1ffabbe (diff)
parent81e3719bce31a74b027e5ba97b5b89d76e133e5e (diff)
Merge "Remove call to fetch_os_creds.sh"
Diffstat (limited to 'functest/tests/unit/cli/commands/test_cli_os.py')
-rw-r--r--functest/tests/unit/cli/commands/test_cli_os.py74
1 files changed, 0 insertions, 74 deletions
diff --git a/functest/tests/unit/cli/commands/test_cli_os.py b/functest/tests/unit/cli/commands/test_cli_os.py
index b551ee4d..c3285ecb 100644
--- a/functest/tests/unit/cli/commands/test_cli_os.py
+++ b/functest/tests/unit/cli/commands/test_cli_os.py
@@ -62,80 +62,6 @@ class CliOpenStackTesting(unittest.TestCase):
mock_exit.assert_called_once_with(0)
@mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
- @mock.patch('functest.cli.commands.cli_os.os.path.isfile',
- return_value=False)
- @mock.patch('functest.cli.commands.cli_os.click.echo')
- def test_fetch_credentials_default(self, mock_click_echo,
- mock_os_path,
- mock_ftutils_execute):
- CONST.__setattr__('INSTALLER_TYPE', self.installer_type)
- CONST.__setattr__('INSTALLER_IP', self.installer_ip)
- cmd = ("fetch_os_creds.sh -d %s -i %s -a %s"
- % (self.openstack_creds,
- self.installer_type,
- self.installer_ip))
- self.cli_os.openstack_creds = self.openstack_creds
- self.cli_os.fetch_credentials()
- mock_click_echo.assert_called_once_with("Fetching credentials from "
- "installer node '%s' with "
- "IP=%s.." %
- (self.installer_type,
- self.installer_ip))
- mock_ftutils_execute.assert_called_once_with(cmd, verbose=False)
-
- @mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
- @mock.patch('functest.cli.commands.cli_os.os.path.isfile',
- return_value=False)
- @mock.patch('functest.cli.commands.cli_os.click.echo')
- def test_fetch_credentials_missing_installer_type(self, mock_click_echo,
- mock_os_path,
- mock_ftutils_execute):
- CONST.__setattr__('INSTALLER_TYPE', None)
- CONST.__setattr__('INSTALLER_IP', self.installer_ip)
- cmd = ("fetch_os_creds.sh -d %s -i %s -a %s"
- % (self.openstack_creds,
- None,
- self.installer_ip))
- self.cli_os.openstack_creds = self.openstack_creds
- self.cli_os.fetch_credentials()
- mock_click_echo.assert_any_call("The environment variable "
- "'INSTALLER_TYPE' is not"
- "defined. Please export it")
- mock_click_echo.assert_any_call("Fetching credentials from "
- "installer node '%s' with "
- "IP=%s.." %
- (None,
- self.installer_ip))
- mock_ftutils_execute.assert_called_once_with(cmd, verbose=False)
-
- @mock.patch('functest.cli.commands.cli_os.ft_utils.execute_command')
- @mock.patch('functest.cli.commands.cli_os.os.path.isfile',
- return_value=False)
- @mock.patch('functest.cli.commands.cli_os.click.echo')
- def test_fetch_credentials_missing_installer_ip(self, mock_click_echo,
- mock_os_path,
- mock_ftutils_execute):
- installer_type = self.installer_type
- installer_ip = None
- CONST.__setattr__('INSTALLER_TYPE', installer_type)
- CONST.__setattr__('INSTALLER_IP', installer_ip)
- cmd = ("fetch_os_creds.sh -d %s -i %s -a %s"
- % (self.openstack_creds,
- installer_type,
- installer_ip))
- self.cli_os.openstack_creds = self.openstack_creds
- self.cli_os.fetch_credentials()
- mock_click_echo.assert_any_call("The environment variable "
- "'INSTALLER_IP' is not"
- "defined. Please export it")
- mock_click_echo.assert_any_call("Fetching credentials from "
- "installer node '%s' with "
- "IP=%s.." %
- (installer_type,
- installer_ip))
- mock_ftutils_execute.assert_called_once_with(cmd, verbose=False)
-
- @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)