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
34d69e57
Kaydet (Commit)
34d69e57
authored
Nis 10, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Skip large file tests on Windowns and OSX.
Reduce large file size to 2**31 (and a bit).
üst
53807dab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
10 deletions
+25
-10
test_io.py
Lib/test/test_io.py
+25
-10
No files found.
Lib/test/test_io.py
Dosyayı görüntüle @
34d69e57
"""Unit tests for io.py."""
"""Unit tests for io.py."""
import
sys
import
unittest
import
unittest
from
itertools
import
chain
from
itertools
import
chain
from
test
import
test_support
from
test
import
test_support
...
@@ -90,21 +91,23 @@ class IOTest(unittest.TestCase):
...
@@ -90,21 +91,23 @@ class IOTest(unittest.TestCase):
f
.
seek
(
-
2
,
2
)
f
.
seek
(
-
2
,
2
)
f
.
truncate
()
f
.
truncate
()
LARGE
=
2
**
31
def
large_file_ops
(
self
,
f
):
def
large_file_ops
(
self
,
f
):
assert
f
.
readable
()
assert
f
.
readable
()
assert
f
.
writable
()
assert
f
.
writable
()
self
.
assertEqual
(
f
.
seek
(
2
**
32
),
2
**
32
)
self
.
assertEqual
(
f
.
seek
(
self
.
LARGE
),
self
.
LARGE
)
self
.
assertEqual
(
f
.
tell
(),
2
**
32
)
self
.
assertEqual
(
f
.
tell
(),
self
.
LARGE
)
self
.
assertEqual
(
f
.
write
(
b
"xxx"
),
3
)
self
.
assertEqual
(
f
.
write
(
b
"xxx"
),
3
)
self
.
assertEqual
(
f
.
tell
(),
2
**
32
+
3
)
self
.
assertEqual
(
f
.
tell
(),
self
.
LARGE
+
3
)
self
.
assertEqual
(
f
.
seek
(
-
1
,
1
),
2
**
32
+
2
)
self
.
assertEqual
(
f
.
seek
(
-
1
,
1
),
self
.
LARGE
+
2
)
f
.
truncate
()
f
.
truncate
()
self
.
assertEqual
(
f
.
tell
(),
2
**
32
+
2
)
self
.
assertEqual
(
f
.
tell
(),
self
.
LARGE
+
2
)
self
.
assertEqual
(
f
.
seek
(
0
,
2
),
2
**
32
+
2
)
self
.
assertEqual
(
f
.
seek
(
0
,
2
),
self
.
LARGE
+
2
)
f
.
truncate
(
2
**
32
+
1
)
f
.
truncate
(
self
.
LARGE
+
1
)
self
.
assertEqual
(
f
.
tell
(),
2
**
32
+
1
)
self
.
assertEqual
(
f
.
tell
(),
self
.
LARGE
+
1
)
self
.
assertEqual
(
f
.
seek
(
0
,
2
),
2
**
32
+
1
)
self
.
assertEqual
(
f
.
seek
(
0
,
2
),
self
.
LARGE
+
1
)
self
.
assertEqual
(
f
.
seek
(
-
1
,
2
),
2
**
32
)
self
.
assertEqual
(
f
.
seek
(
-
1
,
2
),
self
.
LARGE
)
self
.
assertEqual
(
f
.
read
(
2
),
b
"x"
)
self
.
assertEqual
(
f
.
read
(
2
),
b
"x"
)
def
read_ops
(
self
,
f
):
def
read_ops
(
self
,
f
):
...
@@ -148,6 +151,18 @@ class IOTest(unittest.TestCase):
...
@@ -148,6 +151,18 @@ class IOTest(unittest.TestCase):
self
.
read_ops
(
f
)
self
.
read_ops
(
f
)
def
test_large_file_ops
(
self
):
def
test_large_file_ops
(
self
):
# On Windows and Mac OSX this test comsumes large resources; It takes
# a long time to build the >2GB file and takes >2GB of disk space
# therefore the resource must be enabled to run this test.
if
sys
.
platform
[:
3
]
==
'win'
or
sys
.
platform
==
'darwin'
:
if
not
test_support
.
is_resource_enabled
(
"largefile"
):
print
(
"
\n
Testing large file ops skipped on
%
s."
%
sys
.
platform
,
file
=
sys
.
stderr
)
print
(
"It requires
%
d bytes and a long time."
%
self
.
LARGE
,
file
=
sys
.
stderr
)
print
(
"Use 'regrtest.py -u largefile test_io' to run it."
,
file
=
sys
.
stderr
)
return
f
=
io
.
open
(
test_support
.
TESTFN
,
"w+b"
,
buffering
=
0
)
f
=
io
.
open
(
test_support
.
TESTFN
,
"w+b"
,
buffering
=
0
)
self
.
large_file_ops
(
f
)
self
.
large_file_ops
(
f
)
f
.
close
()
f
.
close
()
...
...
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