Exemple #1
0
 def testWriteAfterClose(self):
     r, w = os.pipe()
     fw = FD(w)
     fw.close()
     try:
         with self.assertRaises(OSError) as ar:
             fw.write("oops")
         self.assertEquals(ar.exception.errno, errno.EBADF)
     finally:
         FD(r).close()
Exemple #2
0
 def testWriteAfterClose(self):
     r, w = os.pipe()
     fw = FD(w)
     fw.close()
     try:
         with self.assertRaises(OSError) as ar:
             fw.write("oops")
         self.assertEquals(ar.exception.errno, errno.EBADF)
     finally:
         FD(r).close()
Exemple #3
0
 def testNonblocking(self):
     r, w = os.pipe()
     fr = FD(r)
     try:
         fr.set_nonblocking()
         with self.assertRaises(OSError) as ar:
             fr.read(1)
         self.assertEquals(ar.exception.errno, errno.EAGAIN)
     finally:
         fr.close()
         FD(w).close()
Exemple #4
0
 def testNonblocking(self):
     r, w = os.pipe()
     fr = FD(r)
     try:
         fr.set_nonblocking()
         with self.assertRaises(OSError) as ar:
             fr.read(1)
         self.assertEquals(ar.exception.errno, errno.EAGAIN)
     finally:
         fr.close()
         FD(w).close()