File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import os
33import string
44import unittest
5+ import shutil
56from test .support import TESTFN , run_unittest , unlink , reap_children
67
78if os .name != 'posix' :
@@ -18,6 +19,8 @@ def tearDown(self):
1819 unlink (f )
1920
2021 def testSimplePipe1 (self ):
22+ if shutil .which ('tr' ) is None :
23+ self .skipTest ('tr is not available' )
2124 t = pipes .Template ()
2225 t .append (s_command , pipes .STDIN_STDOUT )
2326 f = t .open (TESTFN , 'w' )
@@ -27,6 +30,8 @@ def testSimplePipe1(self):
2730 self .assertEqual (f .read (), 'HELLO WORLD #1' )
2831
2932 def testSimplePipe2 (self ):
33+ if shutil .which ('tr' ) is None :
34+ self .skipTest ('tr is not available' )
3035 with open (TESTFN , 'w' ) as f :
3136 f .write ('hello world #2' )
3237 t = pipes .Template ()
@@ -36,6 +41,8 @@ def testSimplePipe2(self):
3641 self .assertEqual (f .read (), 'HELLO WORLD #2' )
3742
3843 def testSimplePipe3 (self ):
44+ if shutil .which ('tr' ) is None :
45+ self .skipTest ('tr is not available' )
3946 with open (TESTFN , 'w' ) as f :
4047 f .write ('hello world #2' )
4148 t = pipes .Template ()
You can’t perform that action at this time.
0 commit comments