From 324b981b78ae1d1dfef31b910b272e11ee166cbf Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Wed, 6 Aug 2014 15:07:06 +0800 Subject: [PATCH] Fixes wrong usage of mock.assert_not_called() There is no method assert_not_called in mock, use assertFalse(mock.called) instead of that. Change-Id: I1b37c49e0a624de42d89890b44458ec6bd4239ee --- cinder/tests/test_glusterfs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cinder/tests/test_glusterfs.py b/cinder/tests/test_glusterfs.py index 3ed220b05..0a7e7c1fd 100644 --- a/cinder/tests/test_glusterfs.py +++ b/cinder/tests/test_glusterfs.py @@ -793,7 +793,7 @@ class GlusterFsDriverTestCase(test.TestCase): self.assertTrue(mock_do_umount.called) self.assertTrue(mock_logger.warning.called) - mock_logger.debug.assert_not_called() + self.assertFalse(mock_logger.debug.called) def test_unmount_shares_1share(self): self._driver.shares = {'127.7.7.7:/gluster1': None} @@ -932,7 +932,7 @@ class GlusterFsDriverTestCase(test.TestCase): try: self._driver._do_umount(True, test_share) except putils.ProcessExecutionError: - mock_logger.info.assert_not_called() + self.assertFalse(mock_logger.info.called) self.assertTrue(mock_logger.error.called) except Exception as e: self.fail('Unexpected exception thrown:', e) @@ -1842,8 +1842,8 @@ class GlusterFsDriverTestCase(test.TestCase): mock_local_path_volume.assert_called_with(snapshot['volume']) mock_read_info_file.assert_called_with(info_path) - mock_delete_if_exists.assert_not_called() - mock_write_info_file.assert_not_called() + self.assertFalse(mock_delete_if_exists.called) + self.assertFalse(mock_write_info_file.called) # Test case where snapshot_file != active_file snapshot = {'name': 'fake-volume', -- 2.45.2