summaryrefslogtreecommitdiffstats
path: root/test/unit/common/test_fs_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/common/test_fs_utils.py')
-rw-r--r--test/unit/common/test_fs_utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/common/test_fs_utils.py b/test/unit/common/test_fs_utils.py
index 0f5f6f6..dbf052f 100644
--- a/test/unit/common/test_fs_utils.py
+++ b/test/unit/common/test_fs_utils.py
@@ -517,6 +517,15 @@ class TestFsUtils(unittest.TestCase):
finally:
os.remove(tmpfile)
+ def test_do_close_err_ENOSPC(self):
+
+ def _mock_os_close_enospc(fd):
+ raise OSError(errno.ENOSPC, os.strerror(errno.ENOSPC))
+
+ fd, tmpfile = mkstemp()
+ with patch('os.close', _mock_os_close_enospc):
+ self.assertRaises(DiskFileNoSpace, fs.do_close, fd)
+
def test_do_unlink(self):
fd, tmpfile = mkstemp()
try: