mock.sentinel._handle

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 7

Example 1

Project: bsd-cloudinit Source File: test_physical_disk.py
Function: test_close
    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)

Example 2

Project: cloudbase-init Source File: test_disk.py
Function: test_close
    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)

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)