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")
示例#2
0
 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")
示例#4
0
 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")
示例#5
0
 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'])
示例#6
0
 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'])