def run(): p1 = InputPipeProcessWrapper(["bash", "/tmp/luigi_test_sigpipe.sh"]) counter = 1 for line in p1: self.assertEqual(line, "Welcome %i times\n" % counter) counter += 1 p1.close()
def test_full_read(self): p1 = InputPipeProcessWrapper(["bash", "/tmp/luigi_test_sigpipe.sh"]) counter = 1 for line in p1: self.assertEqual(line, "Welcome %i times\n" % counter) counter += 1 p1.close() self.assertFalse(os.path.exists("/tmp/luigi_sigpipe.marker"))
def test_partial_read(self): p1 = InputPipeProcessWrapper(["bash", "/tmp/luigi_test_sigpipe.sh"]) self.assertEqual(p1.readline(), "Welcome 1 times\n") p1.close() self.assertTrue(os.path.exists("/tmp/luigi_sigpipe.marker"))