def setKnownConsoleSize(self, width, height):
        # Local import to avoid win32 issues.
        import tty
        class FakeFcntl(object):
            def ioctl(self, fd, opt, mutate):
                if opt != tty.TIOCGWINSZ:
                    self.fail("Only window-size queries supported.")
                return struct.pack("4H", height, width, 0, 0)
        self.patch(cftp, "fcntl", FakeFcntl())
For the duration of this test, patch C{cftp}'s C{fcntl} module to return
dataset/ETHPy150Open twisted/twisted/twisted/conch/test/test_cftp.py/StdioClientTests.setKnownConsoleSize