Here are the examples of the python api mock.sentinel._handle taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
3
Example 1
def test_close(self):
self._phys_disk_class._handle = mock.sentinel._handle
self._phys_disk_class._geom = mock.sentinel._geom
self._phys_disk_class.close()
self.physical_disk.kernel32.CloseHandle.assert_called_once_with(
mock.sentinel._handle)
self.assertEqual(0, self._phys_disk_class._handle)
self.assertEqual(None, self._phys_disk_class._geom)
3
Example 2
def test_close(self):
self._device_class._handle = mock.sentinel._handle
self._device_class.close()
self.disk.kernel32.CloseHandle.assert_called_once_with(
mock.sentinel._handle)
self.assertEqual(None, self._device_class._handle)
0
Example 3
Project: bsd-cloudinit Source File: test_physical_disk.py
def test_open_with_close(self):
self._test_open(_handle=mock.sentinel._handle, exception=True)