def testCallErr(self): ex = None try: procOps.callProc(["false"]) except Exception as ex: pass self.failUnless(isinstance(ex, Pipeline.ProcException)) self.failUnlessEqual(str(ex), 'process exited 1: false')
def testCallSimple(self): out = procOps.callProc(["sort", self.getInputFile("simple1.txt")]) self.failUnlessEqual(out, "five\nfour\none\nsix\nthree\ntwo")
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)
def testCallKeepNL(self): out = procOps.callProc(["sort", self.getInputFile("simple1.txt")], keepLastNewLine=True) self.failUnlessEqual(out, "five\nfour\none\nsix\nthree\ntwo\n")