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
0a04819a
Kaydet (Commit)
0a04819a
authored
Eyl 10, 2007
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tr a-z A-Z does not work on Solaris (would require
/usr/xpg4/bin/tr); make the character ranges explicit.
üst
e9fef694
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
test_pipes.py
Lib/test/test_pipes.py
+6
-3
No files found.
Lib/test/test_pipes.py
Dosyayı görüntüle @
0a04819a
...
@@ -9,6 +9,9 @@ if os.name != 'posix':
...
@@ -9,6 +9,9 @@ if os.name != 'posix':
TESTFN2
=
TESTFN
+
"2"
TESTFN2
=
TESTFN
+
"2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command
=
'tr
%
s
%
s'
%
(
string
.
ascii_lowercase
,
string
.
ascii_uppercase
)
class
SimplePipeTests
(
unittest
.
TestCase
):
class
SimplePipeTests
(
unittest
.
TestCase
):
def
tearDown
(
self
):
def
tearDown
(
self
):
for
f
in
(
TESTFN
,
TESTFN2
):
for
f
in
(
TESTFN
,
TESTFN2
):
...
@@ -16,7 +19,7 @@ class SimplePipeTests(unittest.TestCase):
...
@@ -16,7 +19,7 @@ class SimplePipeTests(unittest.TestCase):
def
testSimplePipe1
(
self
):
def
testSimplePipe1
(
self
):
t
=
pipes
.
Template
()
t
=
pipes
.
Template
()
t
.
append
(
'tr a-z A-Z'
,
pipes
.
STDIN_STDOUT
)
t
.
append
(
s_command
,
pipes
.
STDIN_STDOUT
)
f
=
t
.
open
(
TESTFN
,
'w'
)
f
=
t
.
open
(
TESTFN
,
'w'
)
f
.
write
(
'hello world #1'
)
f
.
write
(
'hello world #1'
)
f
.
close
()
f
.
close
()
...
@@ -25,14 +28,14 @@ class SimplePipeTests(unittest.TestCase):
...
@@ -25,14 +28,14 @@ class SimplePipeTests(unittest.TestCase):
def
testSimplePipe2
(
self
):
def
testSimplePipe2
(
self
):
file
(
TESTFN
,
'w'
)
.
write
(
'hello world #2'
)
file
(
TESTFN
,
'w'
)
.
write
(
'hello world #2'
)
t
=
pipes
.
Template
()
t
=
pipes
.
Template
()
t
.
append
(
'tr a-z A-Z
< $IN > $OUT'
,
pipes
.
FILEIN_FILEOUT
)
t
.
append
(
s_command
+
'
< $IN > $OUT'
,
pipes
.
FILEIN_FILEOUT
)
t
.
copy
(
TESTFN
,
TESTFN2
)
t
.
copy
(
TESTFN
,
TESTFN2
)
self
.
assertEqual
(
open
(
TESTFN2
)
.
read
(),
'HELLO WORLD #2'
)
self
.
assertEqual
(
open
(
TESTFN2
)
.
read
(),
'HELLO WORLD #2'
)
def
testSimplePipe3
(
self
):
def
testSimplePipe3
(
self
):
file
(
TESTFN
,
'w'
)
.
write
(
'hello world #2'
)
file
(
TESTFN
,
'w'
)
.
write
(
'hello world #2'
)
t
=
pipes
.
Template
()
t
=
pipes
.
Template
()
t
.
append
(
'tr a-z A-Z
< $IN'
,
pipes
.
FILEIN_STDOUT
)
t
.
append
(
s_command
+
'
< $IN'
,
pipes
.
FILEIN_STDOUT
)
self
.
assertEqual
(
t
.
open
(
TESTFN
,
'r'
)
.
read
(),
'HELLO WORLD #2'
)
self
.
assertEqual
(
t
.
open
(
TESTFN
,
'r'
)
.
read
(),
'HELLO WORLD #2'
)
def
testEmptyPipeline1
(
self
):
def
testEmptyPipeline1
(
self
):
...
...
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