Esempio n. 1
0
 def __formatCommand(command):
     """Turns command list into string, keeping whitespace quoted."""
     return " ".join(procOps.shQuote(command))
Esempio n. 2
0
 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)
Esempio n. 3
0
 def testQuotesBash(self):
     for (words, expect) in self.testData:
         out = procOps.callProc(["sh", "-c", "/bin/echo " + " ".join(procOps.shQuote(words))])
         self.assertEqual(out, expect)
Esempio n. 4
0
 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)
Esempio n. 5
0
 def testQuotesBash(self):
     for (words, expect) in self.testData:
         out = procOps.callProc(
             ["sh", "-c", "/bin/echo " + " ".join(procOps.shQuote(words))])
         self.failUnlessEqual(out, expect)
Esempio n. 6
0
 def __formatCommand(command):
     """Turns command list into string, keeping whitespace quoted."""
     return " ".join(procOps.shQuote(command))