def __formatCommand(command): """Turns command list into string, keeping whitespace quoted.""" return " ".join(procOps.shQuote(command))
def testQuotesCsh(self): # must use /bin/echo, as some csh echos expand backslash sequences for (words, expect) in self.testData: out = procOps.callProc(["csh", "-c", "/bin/echo " + " ".join(procOps.shQuote(words))]) self.assertEqual(out, expect)
def testQuotesBash(self): for (words, expect) in self.testData: out = procOps.callProc(["sh", "-c", "/bin/echo " + " ".join(procOps.shQuote(words))]) self.assertEqual(out, expect)
def testQuotesCsh(self): # must use /bin/echo, as some csh echos expand backslash sequences for (words, expect) in self.testData: out = procOps.callProc( ["csh", "-c", "/bin/echo " + " ".join(procOps.shQuote(words))]) self.failUnlessEqual(out, expect)
def testQuotesBash(self): for (words, expect) in self.testData: out = procOps.callProc( ["sh", "-c", "/bin/echo " + " ".join(procOps.shQuote(words))]) self.failUnlessEqual(out, expect)