def test_special_chars(self): # Mostly just a test that pipes.quote is working properly. # The comnand special characters should pass right through. assert ("bsub -J 'job'\"'\"' nam[e]' -P 'pr{oj n}ame \escape' " "-q '`tick` $(param sub)' run {abc,def}" == build_command([ ['-J', "job' nam[e]"], ['-P', 'pr{oj n}ame \\escape'], ['-q', '`tick` $(param sub)'], ], 'run {abc,def}'))
def test_special_chars(self): # Mostly just a test that pipes.quote is working properly. # The comnand special characters should pass right through. assert ( "bsub -J 'job'\"'\"' nam[e]' -P 'pr{oj n}ame \escape' " "-q '`tick` $(param sub)' run {abc,def}" == build_command([ ['-J', "job' nam[e]"], ['-P', 'pr{oj n}ame \\escape'], ['-q', '`tick` $(param sub)'], ], 'run {abc,def}'))
def test_spaces(self, flags_spaces): assert ("bsub -J 'job name' -P 'proj name' " "-q 'queue with spaces' " "'command with spaces' 'arg with spaces'" == build_command( flags_spaces, "'command with spaces' 'arg with spaces'"))
def test_ptile(self, flags_ptile): assert ("bsub -R 'span[ptile=10]' command --flag flag_arg" == build_command(flags_ptile, 'command --flag flag_arg'))
def test_simple(self, flags_simple): assert ('bsub -J awesomename -P awesomeproj -n 10 command arg1 arg2' == build_command(flags_simple, 'command arg1 arg2'))
def test_spaces(self, flags_spaces): assert ("bsub -J 'job name' -P 'proj name' " "-q 'queue with spaces' " "'command with spaces' 'arg with spaces'" == build_command( flags_spaces, "'command with spaces' 'arg with spaces'"))
def test_ptile(self, flags_ptile): assert ("bsub -R 'span[ptile=10]' command --flag flag_arg" == build_command(flags_ptile, 'command --flag flag_arg'))
def test_simple(self, flags_simple): assert ('bsub -J awesomename -P awesomeproj -n 10 command arg1 arg2' == build_command(flags_simple, 'command arg1 arg2'))