Fix mock calls

Use the proper assert methods of the mock objects.

Squashed with Icc2c4095b78ef4dba091fc6792f0a38de1fda267 so
we can merge this change.

Change-Id: I8474b6a5cef1133fa6cb36bf08962113c6d908dc
This commit is contained in:
Doug Hellmann 2015-07-10 13:38:07 +00:00 committed by Davanum Srinivas
parent d8ccf388f9
commit a1a6393990
3 changed files with 6 additions and 5 deletions

View File

@ -255,7 +255,7 @@ class ImageTransferUtilityTest(base.TestCase):
self.assertEqual(len(write_file_handles),
read_file_handle.close.call_count)
write_file_handle1.close.assert_called_once()
write_file_handle1.close.assert_called_once_with()
@mock.patch.object(image_transfer, 'FileReadWriteTask')
@mock.patch.object(image_transfer, 'BlockingQueue')
@ -403,7 +403,7 @@ class ImageTransferUtilityTest(base.TestCase):
image_size,
write_file_handle=fake_VmdkWriteHandle)
fake_VmdkWriteHandle.get_imported_vm.assert_called_once()
fake_VmdkWriteHandle.get_imported_vm.assert_called_once_with()
@mock.patch('oslo_vmware.rw_handles.ImageReadHandle')
@mock.patch.object(image_transfer, 'download_stream_optimized_data')

View File

@ -142,7 +142,7 @@ class ServiceTest(base.TestCase):
self.assertEqual(fault_list, ex.fault_list)
self.assertEqual({'name': 'value'}, ex.details)
self.assertEqual("MyFault", ex.msg)
doc.childAtPath.assertCalledOnceWith('/detail')
doc.childAtPath.assert_called_once_with('/detail')
def test_request_handler_with_empty_web_fault_doc(self):
@ -227,7 +227,7 @@ class ServiceTest(base.TestCase):
self.assertEqual([exceptions.NOT_AUTHENTICATED], ex.fault_list)
self.assertEqual({'name': 'value'}, ex.details)
self.assertEqual("MyFault", ex.msg)
doc.childAtPath.assertCalledOnceWith('/detail')
doc.childAtPath.assert_called_once_with('/detail')
def test_request_handler_with_attribute_error(self):
managed_object = 'VirtualMachine'

View File

@ -7,7 +7,8 @@ hacking<0.11,>=0.10.0
discover
fixtures>=1.3.1
mock>=1.0
mock>=1.1;python_version!='2.6'
mock==1.0.1;python_version=='2.6'
mox3>=0.7.0
python-subunit>=0.0.18
testrepository>=0.0.18