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
fd48a56b
Kaydet (Commit)
fd48a56b
authored
Mar 03, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Correct and improve comments in test_fileinput (closes #20501).
Thanks Vajrasky Kok and Zachary Ware.
üst
695870a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
test_fileinput.py
Lib/test/test_fileinput.py
+3
-3
No files found.
Lib/test/test_fileinput.py
Dosyayı görüntüle @
fd48a56b
...
...
@@ -228,6 +228,8 @@ class FileInputTests(unittest.TestCase):
self
.
addCleanup
(
safe_unlink
,
TESTFN
)
fi
=
FileInput
(
files
=
TESTFN
,
openhook
=
hook_encoded
(
'ascii'
),
bufsize
=
8
)
# The most likely failure is a UnicodeDecodeError due to the entire
# file being read when it shouldn't have been.
self
.
assertEqual
(
fi
.
readline
(),
u'A
\n
'
)
self
.
assertEqual
(
fi
.
readline
(),
u'B
\r\n
'
)
self
.
assertEqual
(
fi
.
readline
(),
u'C
\r
'
)
...
...
@@ -240,11 +242,9 @@ class Test_hook_encoded(unittest.TestCase):
"""Unit tests for fileinput.hook_encoded()"""
def
test_modes
(
self
):
# Unlikely UTF-7 is locale encoding
with
open
(
TESTFN
,
'wb'
)
as
f
:
# UTF-7 is a convenient, seldom used encoding
f
.
write
(
'A
\n
B
\r\n
C
\r
D+IKw-'
)
t1
=
TESTFN
#t1 = writeTmp(1, ['A\nB\r\nC\rD+IKw-'], mode='wb')
self
.
addCleanup
(
safe_unlink
,
TESTFN
)
def
check
(
mode
,
expected_lines
):
...
...
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