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.assertEqual(dr.get(), "two\nthree\nsix\none\nfour\nfive\n") self.commonChecks(nopen, pd, "^sort -r <.+/input/simple1\\.txt >\\[DataWriter\\]", isRe=True)
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.assertEqual(dr.get(), "one\ntwo\nthree\nfour\nfive\nsix\n") self.commonChecks(nopen, pd, "^tee \\[DataWriter\\] <.+/input/simple1.txt >/dev/null$", isRe=True)