Example #1
0
 def testStdoutMem(self):
     "read from stdout into memory"
     nopen = self.numOpenFiles()
     pd = ProcDag()
     inf = self.getInputFile("simple1.txt")
     dr = DataReader()
     pd.create(("sort","-r"), stdin=inf, stdout=dr)
     pd.wait()
     self.failUnlessEqual(dr.get(), "two\nthree\nsix\none\nfour\nfive\n")
     self.commonChecks(nopen, pd, "^sort -r <.+/input/simple1\\.txt >\\[DataWriter\\]", isRe=True)
Example #2
0
 def testOutArgMem(self):
     "read from a pipe argument into memory"
     nopen = self.numOpenFiles()
     pd = ProcDag()
     inf = self.getInputFile("simple1.txt")
     dr = DataReader()
     pr = pd.create(("tee",POut(dr)), stdin=inf, stdout="/dev/null")
     pd.wait()
     self.failUnlessEqual(dr.get(), "one\ntwo\nthree\nfour\nfive\nsix\n")
     self.commonChecks(nopen, pd, "^tee \\[DataWriter\\] <.+/input/simple1.txt >/dev/null$", isRe=True)
Example #3
0
 def testOutArgNoOpen(self):
     "write to a pipe argument that doesn't get open"
     nopen = self.numOpenFiles()
     pd = ProcDag()
     dr = DataReader()
     pr = pd.create(("true", POut(dr)), stdin="/dev/null")
     pd.wait()
     self.commonChecks(nopen, pd, "true [DataWriter] </dev/null")