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
812d8341
Kaydet (Commit)
812d8341
authored
May 29, 2007
tarafından
Walter Dörwald
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix test_pty.py.
üst
c0257148
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
test_pty.py
Lib/test/test_pty.py
+7
-7
No files found.
Lib/test/test_pty.py
Dosyayı görüntüle @
812d8341
...
@@ -30,12 +30,12 @@ def normalize_output(data):
...
@@ -30,12 +30,12 @@ def normalize_output(data):
# from someone more knowledgable.
# from someone more knowledgable.
# OSF/1 (Tru64) apparently turns \n into \r\r\n.
# OSF/1 (Tru64) apparently turns \n into \r\r\n.
if
data
.
endswith
(
'
\r\r\n
'
):
if
data
.
endswith
(
b
'
\r\r\n
'
):
return
data
.
replace
(
'
\r\r\n
'
,
'
\n
'
)
return
data
.
replace
(
b
'
\r\r\n
'
,
b
'
\n
'
)
# IRIX apparently turns \n into \r\n.
# IRIX apparently turns \n into \r\n.
if
data
.
endswith
(
'
\r\n
'
):
if
data
.
endswith
(
b
'
\r\n
'
):
return
data
.
replace
(
'
\r\n
'
,
'
\n
'
)
return
data
.
replace
(
b
'
\r\n
'
,
b
'
\n
'
)
return
data
return
data
...
@@ -92,14 +92,14 @@ class PtyTest(unittest.TestCase):
...
@@ -92,14 +92,14 @@ class PtyTest(unittest.TestCase):
debug
(
"Writing to slave_fd"
)
debug
(
"Writing to slave_fd"
)
os
.
write
(
slave_fd
,
TEST_STRING_1
)
os
.
write
(
slave_fd
,
TEST_STRING_1
)
s1
=
os
.
read
(
master_fd
,
1024
)
s1
=
os
.
read
(
master_fd
,
1024
)
self
.
assertEquals
(
'I wish to buy a fish license.
\n
'
,
self
.
assertEquals
(
b
'I wish to buy a fish license.
\n
'
,
normalize_output
(
s1
))
normalize_output
(
s1
))
debug
(
"Writing chunked output"
)
debug
(
"Writing chunked output"
)
os
.
write
(
slave_fd
,
TEST_STRING_2
[:
5
])
os
.
write
(
slave_fd
,
TEST_STRING_2
[:
5
])
os
.
write
(
slave_fd
,
TEST_STRING_2
[
5
:])
os
.
write
(
slave_fd
,
TEST_STRING_2
[
5
:])
s2
=
os
.
read
(
master_fd
,
1024
)
s2
=
os
.
read
(
master_fd
,
1024
)
self
.
assertEquals
(
'For my pet fish, Eric.
\n
'
,
normalize_output
(
s2
))
self
.
assertEquals
(
b
'For my pet fish, Eric.
\n
'
,
normalize_output
(
s2
))
os
.
close
(
slave_fd
)
os
.
close
(
slave_fd
)
os
.
close
(
master_fd
)
os
.
close
(
master_fd
)
...
@@ -157,7 +157,7 @@ class PtyTest(unittest.TestCase):
...
@@ -157,7 +157,7 @@ class PtyTest(unittest.TestCase):
break
break
if
not
data
:
if
not
data
:
break
break
sys
.
stdout
.
write
(
data
.
replace
(
'
\r\n
'
,
'
\n
'
))
sys
.
stdout
.
write
(
data
.
replace
(
'
\r\n
'
,
'
\n
'
)
.
decode
(
'ascii'
)
)
##line = os.read(master_fd, 80)
##line = os.read(master_fd, 80)
##lines = line.replace('\r\n', '\n').split('\n')
##lines = line.replace('\r\n', '\n').split('\n')
...
...
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