def test_openFDs(self):
        """
        File descriptors returned by L{_listOpenFDs} are mostly open.

        This test assumes that zero-legth writes fail with EBADF on closed
        file descriptors.
        """
        for fd in process._listOpenFDs():
            try:
                fcntl.fcntl(fd, fcntl.F_GETFL)
            except __HOLE__, err:
                self.assertEquals(
                    errno.EBADF, err.errno,
                    "fcntl(%d, F_GETFL) failed with unexpected errno %d" % (
                        fd, err.errno))
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/test/test_posixprocess.py/FileDescriptorTests.test_openFDs