aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/ci/test_prepare_env.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-07-12 15:12:22 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-12 15:12:22 +0000
commit0323218afb7500bac979e46aafc9c33d614c99d5 (patch)
tree48cecb3992b98dabcc30e1a27c97dd8de69a9082 /functest/tests/unit/ci/test_prepare_env.py
parentf81e3d2cf3cf9b54f940a6e0ae0ea68db0e1f589 (diff)
parent3bb72f47f704f25d957d8f00b82360fe8b6b2f7a (diff)
Merge "Switch to check_deployment instead of check_os.sh"
Diffstat (limited to 'functest/tests/unit/ci/test_prepare_env.py')
-rw-r--r--functest/tests/unit/ci/test_prepare_env.py24
1 files changed, 10 insertions, 14 deletions
diff --git a/functest/tests/unit/ci/test_prepare_env.py b/functest/tests/unit/ci/test_prepare_env.py
index 7d4b5fb2..7d5fa564 100644
--- a/functest/tests/unit/ci/test_prepare_env.py
+++ b/functest/tests/unit/ci/test_prepare_env.py
@@ -309,22 +309,18 @@ class PrepareEnvTesting(unittest.TestCase):
prepare_env.update_config_file()
self.assertTrue(mock_db_url.called)
- @mock.patch('functest.ci.prepare_env.logger.info')
- def test_verify_deployment_error(self, mock_logger_error):
- mock_popen = mock.Mock()
- attrs = {'poll.return_value': None,
- 'stdout.readline.return_value': 'ERROR'}
- mock_popen.configure_mock(**attrs)
+ def test_verify_deployment(self):
+ with mock.patch('functest.ci.check_deployment.CheckDeployment') \
+ as mock_check_deployment:
+ prepare_env.verify_deployment()
+ self.assertTrue(mock_check_deployment.called)
- with mock.patch('functest.ci.prepare_env.print_separator') as m, \
- mock.patch('functest.ci.prepare_env.subprocess.Popen',
- return_value=mock_popen), \
- self.assertRaises(Exception) as context:
+ def test_verify_deployment_error(self):
+ with mock.patch('functest.ci.prepare_env.'
+ 'check_deployment.CheckDeployment',
+ return_value=('test_', None)), \
+ self.assertRaises(Exception):
prepare_env.verify_deployment()
- self.assertTrue(m.called)
- msg = "Problem while running 'check_os.sh'."
- mock_logger_error.assert_called_once_with('ERROR')
- self.assertTrue(msg in context)
def _get_rally_creds(self):
return {"type": "ExistingCloud",