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
82fb71d6
Kaydet (Commit)
82fb71d6
authored
Agu 21, 2013
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleanup test_builtin
üst
0f24b879
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
test_builtin.py
Lib/test/test_builtin.py
+4
-12
No files found.
Lib/test/test_builtin.py
Dosyayı görüntüle @
82fb71d6
...
...
@@ -976,29 +976,25 @@ class BuiltinTest(unittest.TestCase):
def
write_testfile
(
self
):
# NB the first 4 lines are also used to test input, below
fp
=
open
(
TESTFN
,
'w'
)
try
:
self
.
addCleanup
(
unlink
,
TESTFN
)
with
fp
:
fp
.
write
(
'1+1
\n
'
)
fp
.
write
(
'The quick brown fox jumps over the lazy dog'
)
fp
.
write
(
'.
\n
'
)
fp
.
write
(
'Dear John
\n
'
)
fp
.
write
(
'XXX'
*
100
)
fp
.
write
(
'YYY'
*
100
)
finally
:
fp
.
close
()
def
test_open
(
self
):
self
.
write_testfile
()
fp
=
open
(
TESTFN
,
'r'
)
try
:
with
fp
:
self
.
assertEqual
(
fp
.
readline
(
4
),
'1+1
\n
'
)
self
.
assertEqual
(
fp
.
readline
(),
'The quick brown fox jumps over the lazy dog.
\n
'
)
self
.
assertEqual
(
fp
.
readline
(
4
),
'Dear'
)
self
.
assertEqual
(
fp
.
readline
(
100
),
' John
\n
'
)
self
.
assertEqual
(
fp
.
read
(
300
),
'XXX'
*
100
)
self
.
assertEqual
(
fp
.
read
(
1000
),
'YYY'
*
100
)
finally
:
fp
.
close
()
unlink
(
TESTFN
)
def
test_open_default_encoding
(
self
):
old_environ
=
dict
(
os
.
environ
)
...
...
@@ -1013,11 +1009,8 @@ class BuiltinTest(unittest.TestCase):
self
.
write_testfile
()
current_locale_encoding
=
locale
.
getpreferredencoding
(
False
)
fp
=
open
(
TESTFN
,
'w'
)
try
:
with
fp
:
self
.
assertEqual
(
fp
.
encoding
,
current_locale_encoding
)
finally
:
fp
.
close
()
unlink
(
TESTFN
)
finally
:
os
.
environ
.
clear
()
os
.
environ
.
update
(
old_environ
)
...
...
@@ -1132,7 +1125,6 @@ class BuiltinTest(unittest.TestCase):
sys
.
stdin
=
savestdin
sys
.
stdout
=
savestdout
fp
.
close
()
unlink
(
TESTFN
)
@unittest.skipUnless
(
pty
,
"the pty and signal modules must be available"
)
def
check_input_tty
(
self
,
prompt
,
terminal_input
,
stdio_encoding
=
None
):
...
...
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