def test_creation_destruction(self): def cb(bs, _): print_d(bs) with temp_filename() as fn: fifo = FIFO(fn, cb) self.failIf(fifo_exists(fifo._path)) fifo.open() self.failUnless(fifo_exists(fifo._path)) # Should *not* error if file is gone fifo.destroy()
def test_unwriteable_location(self): fifo = FIFO("/dev/not-here", None) fifo.open() with self.assertRaises(OSError): write_fifo(fifo._path, "foobar".encode()) fifo.destroy()