예제 #1
0
 def test_disk_delete(self):
     with contextlib.nested(
         mock.patch.object(self.session, '_wait_for_task'),
         mock.patch.object(self.session, '_call_method',
                           return_value=mock.sentinel.cm)
     ) as (_wait_for_task, _call_method):
         ds_util.disk_delete(self.session,
                             'fake-dc-ref', '[ds] tmp/disk.vmdk')
         _wait_for_task.assert_called_once_with(mock.sentinel.cm)
         _call_method.assert_called_once_with(
                 mock.ANY, 'DeleteVirtualDisk_Task', 'VirtualDiskManager',
                 datacenter='fake-dc-ref', name='[ds] tmp/disk.vmdk')
예제 #2
0
 def test_disk_delete(self):
     with contextlib.nested(
             mock.patch.object(self.session, '_wait_for_task'),
             mock.patch.object(
                 self.session,
                 '_call_method',
                 return_value=mock.sentinel.cm)) as (_wait_for_task,
                                                     _call_method):
         ds_util.disk_delete(self.session, 'fake-dc-ref',
                             '[ds] tmp/disk.vmdk')
         _wait_for_task.assert_called_once_with(mock.sentinel.cm)
         _call_method.assert_called_once_with(mock.ANY,
                                              'DeleteVirtualDisk_Task',
                                              'VirtualDiskManager',
                                              datacenter='fake-dc-ref',
                                              name='[ds] tmp/disk.vmdk')