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
c5ae86b9
Kaydet (Commit)
c5ae86b9
authored
Haz 12, 2009
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Re-enable testing of builtin open() in test_bufio in test_largefile
üst
47a5f480
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
test_bufio.py
Lib/test/test_bufio.py
+4
-1
test_largefile.py
Lib/test/test_largefile.py
+9
-3
No files found.
Lib/test/test_bufio.py
Dosyayı görüntüle @
c5ae86b9
...
...
@@ -68,9 +68,12 @@ class CBufferSizeTest(BufferSizeTest):
class
PyBufferSizeTest
(
BufferSizeTest
):
open
=
staticmethod
(
pyio
.
open
)
class
BuiltinBufferSizeTest
(
BufferSizeTest
):
open
=
open
def
test_main
():
support
.
run_unittest
(
CBufferSizeTest
,
PyBufferSizeTest
)
support
.
run_unittest
(
CBufferSizeTest
,
PyBufferSizeTest
,
BuiltinBufferSizeTest
)
if
__name__
==
"__main__"
:
test_main
()
Lib/test/test_largefile.py
Dosyayı görüntüle @
c5ae86b9
...
...
@@ -124,20 +124,24 @@ class LargeFileTest(unittest.TestCase):
newsize
-=
1
f
.
seek
(
42
)
f
.
truncate
(
newsize
)
self
.
assertEqual
(
f
.
tell
(),
newsize
)
# else wasn't truncated
if
self
.
new_io
:
self
.
assertEqual
(
f
.
tell
(),
newsize
)
# else wasn't truncated
f
.
seek
(
0
,
2
)
self
.
assertEqual
(
f
.
tell
(),
newsize
)
# XXX truncate(larger than true size) is ill-defined
# across platform; cut it waaaaay back
f
.
seek
(
0
)
f
.
truncate
(
1
)
self
.
assertEqual
(
f
.
tell
(),
1
)
# else pointer moved
if
self
.
new_io
:
self
.
assertEqual
(
f
.
tell
(),
1
)
# else pointer moved
f
.
seek
(
0
)
self
.
assertEqual
(
len
(
f
.
read
()),
1
)
# else wasn't truncated
def
test_seekable
(
self
):
# Issue #5016; seekable() can return False when the current position
# is negative when truncated to an int.
if
not
self
.
new_io
:
self
.
skipTest
(
"builtin file doesn't have seekable()"
)
for
pos
in
(
2
**
31
-
1
,
2
**
31
,
2
**
31
+
1
):
with
self
.
open
(
TESTFN
,
'rb'
)
as
f
:
f
.
seek
(
pos
)
...
...
@@ -171,10 +175,12 @@ def test_main():
else
:
f
.
close
()
suite
=
unittest
.
TestSuite
()
for
_open
,
prefix
in
[(
io
.
open
,
'C'
),
(
pyio
.
open
,
'Py'
)]:
for
_open
,
prefix
in
[(
io
.
open
,
'C'
),
(
pyio
.
open
,
'Py'
),
(
open
,
'Builtin'
)]:
class
TestCase
(
LargeFileTest
):
pass
TestCase
.
open
=
staticmethod
(
_open
)
TestCase
.
new_io
=
_open
is
not
open
TestCase
.
__name__
=
prefix
+
LargeFileTest
.
__name__
suite
.
addTest
(
TestCase
(
'test_seek'
))
suite
.
addTest
(
TestCase
(
'test_osstat'
))
...
...
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