def test_correctLookups(self): """ Given an known-good errno, make sure that formatMessage gives results matching either C{socket.errorTab}, C{ctypes.WinError}, or C{win32api.FormatMessage}. """ acceptable = [socket.errorTab[ECONNABORTED]] try: from ctypes import WinError acceptable.append(WinError(ECONNABORTED).strerror) except ImportError: pass try: from win32api import FormatMessage acceptable.append(FormatMessage(ECONNABORTED)) except ImportError: pass self.assertIn(formatError(ECONNABORTED), acceptable)
def test_correctLookups(self): """ Given a known-good errno, make sure that formatMessage gives results matching either C{socket.errorTab}, C{ctypes.WinError}, or C{win32api.FormatMessage}. """ acceptable = [socket.errorTab[ECONNABORTED]] try: from ctypes import WinError acceptable.append(WinError(ECONNABORTED).strerror) except ImportError: pass try: from win32api import FormatMessage acceptable.append(FormatMessage(ECONNABORTED)) except ImportError: pass self.assertIn(formatError(ECONNABORTED), acceptable)