<s> """<STR_LIT>""" <EOL> import sys , os <EOL> import unittest <EOL> try : <EOL> import slurmmon <EOL> except ImportError : <EOL> sys . path . append ( os . path . abspath ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT>' ) ) ) <EOL> import slurmmon <EOL> from slurmmon import util as u <EOL> class ShTestCase ( unittest . TestCase ) : <EOL> funky_string = r"""<STR_LIT>""" <EOL> funky_string_quoted = r"""<STR_LIT>""" <EOL> def test_runsh_string ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> u . runsh ( '<STR_LIT>' ) , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def test_runsh_list ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> u . runsh ( [ '<STR_LIT>' , '<STR_LIT:foo>' ] ) , <EOL> '<STR_LIT>' , <EOL> ) <EOL> def test_runsh_i_string ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> [ line for line in u . runsh_i ( "<STR_LIT>" ) ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ) <EOL> def test_runsh_list ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> [ line for line in u . runsh_i ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> ) <EOL> def test_shquote ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> u . shquote ( ShTestCase . funky_string ) , <EOL> ShTestCase . funky_string_quoted <EOL> ) <EOL> def test_shquote_runsh ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( <EOL> u . runsh ( '<STR_LIT>' % u . shquote ( ShTestCase . funky_string ) ) , <EOL> ShTestCase . funky_string <EOL> ) <EOL> def test_sherrcheck_status ( self ) : <EOL> self . assertRaises ( Exception , u . runsh , [ '<STR_LIT:false>' ] ) <EOL> def test_sherrcheck_stderr ( self ) : <EOL> self . assertRaises ( Exception , u . runsh , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
