aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils
diff options
context:
space:
mode:
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>2017-02-03 12:01:12 +0200
committerGeorge Paraskevopoulos <geopar@intracom-telecom.com>2017-02-03 16:13:52 +0200
commitfad072617783d6790eece5265d6e320a3ac36a81 (patch)
treec63ed306c168f37cf68527a9453dccffd615acb0 /functest/tests/unit/utils
parentf6f929ae158be1b52cd0ffc0c1f02eb7709504f1 (diff)
Fix template error log
JIRA:SFC-70 Printing the VNFD template during VNFD creation was left on error level. Move it on info level and make printing prettier. Fix unit test for create_vnfd Change-Id: Ib04a43d72abcf9b6fbcaec9ea05d57b9f017b53f Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
Diffstat (limited to 'functest/tests/unit/utils')
-rw-r--r--functest/tests/unit/utils/test_openstack_tacker.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/functest/tests/unit/utils/test_openstack_tacker.py b/functest/tests/unit/utils/test_openstack_tacker.py
index a8330c0e..dc717258 100644
--- a/functest/tests/unit/utils/test_openstack_tacker.py
+++ b/functest/tests/unit/utils/test_openstack_tacker.py
@@ -146,8 +146,7 @@ class OSTackerTesting(unittest.TestCase):
tosca_file=None)
self.assertEqual(resp, self.createvnfd)
- @mock.patch('functest.utils.openstack_tacker.logger.error')
- def test_create_vnfd_default(self, mock_logger_error):
+ def test_create_vnfd_default(self):
with mock.patch.object(self.tacker_client, 'create_vnfd',
return_value=self.createvnfd), \
mock.patch('__builtin__.open', mock.mock_open(read_data='1')) \
@@ -155,16 +154,15 @@ class OSTackerTesting(unittest.TestCase):
resp = openstack_tacker.create_vnfd(self.tacker_client,
tosca_file=self.tosca_file)
m.assert_called_once_with(self.tosca_file)
- mock_logger_error.assert_called_once_with('1')
self.assertEqual(resp, self.createvnfd)
- @mock.patch('functest.utils.openstack_tacker.logger.exception')
- def test_create_vnfd_exception(self, mock_logger_excep):
+ @mock.patch('functest.utils.openstack_tacker.logger.error')
+ def test_create_vnfd_exception(self, mock_logger_error):
with mock.patch.object(self.tacker_client, 'create_vnfd',
side_effect=Exception):
resp = openstack_tacker.create_vnfd(self.tacker_client,
tosca_file=self.tosca_file)
- mock_logger_excep.assert_called_once_with(test_utils.
+ mock_logger_error.assert_called_once_with(test_utils.
SubstrMatch("Error"
" [create"
"_vnfd("