def testBadShell( self ): "Attempting to get an environment with a shell that is not startable" dprint( "testBadShell: ignore warnings about failing to get environment") se2 = javashell._ShellEnv( ["badshell", "-c"], "set" ) str(se2.environment) # trigger initialization assert not se2.environment.items(), "environment should be empty" dprint( "end testBadShell")
def testBadShell(self): "Attempting to get an environment with a shell that is not startable" dprint( "testBadShell: ignore warnings about failing to get environment") se2 = javashell._ShellEnv(["badshell", "-c"], "set") str(se2.environment) # trigger initialization assert not se2.environment.items(), "environment should be empty" dprint("end testBadShell")
def testBadGetEnv( self ): "Attempting to get an environment with a command that does not print an environment" dprint( "testBadGetEnv: ignore warnings about command not printing environment") envCmd="echo This command does not print environment" se2 = javashell._ShellEnv( javashell._shellEnv.cmd, envCmd, None ) str(se2.environment) # trigger initialization assert not se2.environment.items(), "environment should be empty" dprint( "end testBadGetEnv")
def testBadGetEnv(self): "Attempting to get an environment with a command that does not print an environment" dprint( "testBadGetEnv: ignore warnings about command not printing environment" ) envCmd = "echo This command does not print environment" se2 = javashell._ShellEnv(javashell._shellEnv.cmd, envCmd, None) str(se2.environment) # trigger initialization assert not se2.environment.items(), "environment should be empty" dprint("end testBadGetEnv")
def testFormatUnicodeCommand(self): shell = javashell._ShellEnv(cmd=['runner']) self.assertEqual(shell._formatCmd('echo hello'), ['runner', 'echo hello']) self.assertEqual(shell._formatCmd('echo world'), ['runner', 'echo world'])
def testFormatUnicodeCommand(self): shell = javashell._ShellEnv(cmd=['runner']) self.assertEqual(shell._formatCmd('echo hello'), ['runner', 'echo hello']) self.assertEqual(shell._formatCmd(u'echo world'), ['runner', u'echo world'])