Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
d46f7d20
Kaydet (Commit)
d46f7d20
authored
Tem 07, 2012
tarafından
Jesus Cea
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cope with OSs lying - #10142: Support for SEEK_HOLE/SEEK_DATA
üst
ccd712a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
test_posix.py
Lib/test/test_posix.py
+12
-8
No files found.
Lib/test/test_posix.py
Dosyayı görüntüle @
d46f7d20
...
...
@@ -1017,9 +1017,6 @@ class PosixTester(unittest.TestCase):
@unittest.skipUnless
(
hasattr
(
os
,
'SEEK_HOLE'
),
"test needs an OS that reports file holes"
)
@unittest.skipIf
(
sys
.
platform
in
(
'freebsd7'
,
'freebsd8'
,
'freebsd9'
),
"Skip test because known kernel bug - "
\
"http://lists.freebsd.org/pipermail/freebsd-amd64/2012-January/014332.html"
)
def
test_fs_holes
(
self
):
# Even if the filesystem doesn't report holes,
# if the OS supports it the SEEK_* constants
...
...
@@ -1032,11 +1029,18 @@ class PosixTester(unittest.TestCase):
fp
.
flush
()
size
=
fp
.
tell
()
fno
=
fp
.
fileno
()
for
i
in
range
(
size
):
self
.
assertEqual
(
i
,
os
.
lseek
(
fno
,
i
,
os
.
SEEK_DATA
))
self
.
assertLessEqual
(
size
,
os
.
lseek
(
fno
,
i
,
os
.
SEEK_HOLE
))
self
.
assertRaises
(
OSError
,
os
.
lseek
,
fno
,
size
,
os
.
SEEK_DATA
)
self
.
assertRaises
(
OSError
,
os
.
lseek
,
fno
,
size
,
os
.
SEEK_HOLE
)
try
:
for
i
in
range
(
size
):
self
.
assertEqual
(
i
,
os
.
lseek
(
fno
,
i
,
os
.
SEEK_DATA
))
self
.
assertLessEqual
(
size
,
os
.
lseek
(
fno
,
i
,
os
.
SEEK_HOLE
))
self
.
assertRaises
(
OSError
,
os
.
lseek
,
fno
,
size
,
os
.
SEEK_DATA
)
self
.
assertRaises
(
OSError
,
os
.
lseek
,
fno
,
size
,
os
.
SEEK_HOLE
)
except
OSError
:
# Some OSs claim to support SEEK_HOLE/SEEK_DATA
# but it is not true.
# For instance:
# http://lists.freebsd.org/pipermail/freebsd-amd64/2012-January/014332.html
raise
unittest
.
SkipTest
(
"OSError raised!"
)
class
PosixGroupsTester
(
unittest
.
TestCase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment