summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pipes.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-09-10 06:18:32 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-09-10 06:18:32 (GMT)
commit0a04819a1354f4c0aa6e1287a465054f491f8f9b (patch)
tree28077eafeb87a9d4fd44352c81d610ed53da56f6 /Lib/test/test_pipes.py
parente9fef694b4929d535a7c12480b5adae28d394d79 (diff)
downloadcpython-0a04819a1354f4c0aa6e1287a465054f491f8f9b.zip
cpython-0a04819a1354f4c0aa6e1287a465054f491f8f9b.tar.gz
cpython-0a04819a1354f4c0aa6e1287a465054f491f8f9b.tar.bz2
tr a-z A-Z does not work on Solaris (would require
/usr/xpg4/bin/tr); make the character ranges explicit.
Diffstat (limited to 'Lib/test/test_pipes.py')
-rw-r--r--Lib/test/test_pipes.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py
index a440ac1..0eca8ed 100644
--- a/Lib/test/test_pipes.py
+++ b/Lib/test/test_pipes.py
@@ -9,6 +9,9 @@ if os.name != 'posix':
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):
def tearDown(self):
for f in (TESTFN, TESTFN2):
@@ -16,7 +19,7 @@ class SimplePipeTests(unittest.TestCase):
def testSimplePipe1(self):
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.write('hello world #1')
f.close()
@@ -25,14 +28,14 @@ class SimplePipeTests(unittest.TestCase):
def testSimplePipe2(self):
file(TESTFN, 'w').write('hello world #2')
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)
self.assertEqual(open(TESTFN2).read(), 'HELLO WORLD #2')
def testSimplePipe3(self):
file(TESTFN, 'w').write('hello world #2')
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')
def testEmptyPipeline1(self):