From fad072617783d6790eece5265d6e320a3ac36a81 Mon Sep 17 00:00:00 2001 From: George Paraskevopoulos Date: Fri, 3 Feb 2017 12:01:12 +0200 Subject: 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 --- functest/tests/unit/utils/test_openstack_tacker.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'functest/tests') 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(" -- cgit 1.2.3-korg