Skip to content

Commit ebe58e5

Browse files
committed
Add more tests
1 parent d0d9677 commit ebe58e5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Lib/test/test_fcntl.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,17 @@ def test_preallocate(self):
293293
self.f = open(TESTFN, 'wb+')
294294
fd = self.f.fileno()
295295

296-
result = fcntl.preallocate(fd, fcntl.F_ALLOCATECONTIG, fcntl.F_PEOFPOSMODE, 0, 1024)
296+
result = fcntl.preallocate(fd, fcntl.F_ALLOCATECONTIG, fcntl.F_PEOFPOSMODE, 0, 128)
297297
self.assertIsInstance(result, int)
298-
self.assertEqual(result, 1024)
298+
self.assertEqual(result, 128)
299+
300+
result = fcntl.preallocate(fd, fcntl.F_ALLOCATEALL, fcntl.F_PEOFPOSMODE, 0, 256)
301+
self.assertIsInstance(result, int)
302+
self.assertEqual(result, 256)
303+
304+
result = fcntl.preallocate(fd, fcntl.F_ALLOCATEPERSIST, fcntl.F_PEOFPOSMODE, 0, 512)
305+
self.assertIsInstance(result, int)
306+
self.assertEqual(result, 512)
299307

300308

301309
if __name__ == '__main__':

0 commit comments

Comments
 (0)