From: Thomas Heller Date: Fri, 13 Jul 2007 14:18:06 +0000 (+0000) Subject: Add tests for _ctypes.COMError. X-Git-Tag: v2.6a1~1573 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1fd1cc5be28cdf13758ead4a28a63e871ebad91d;p=python Add tests for _ctypes.COMError. --- diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py index 057873c57e..5067b60815 100644 --- a/Lib/ctypes/test/test_win32.py +++ b/Lib/ctypes/test/test_win32.py @@ -58,6 +58,15 @@ if sys.platform == "win32": self.failUnlessEqual(sizeof(wintypes.LPARAM), sizeof(c_void_p)) + def test_COMError(self): + from _ctypes import COMError + self.assertEqual(COMError.__doc__, "Raised when a COM method call failed.") + + ex = COMError(-1, "text", ("details",)) + self.assertEqual(ex.hresult, -1) + self.assertEqual(ex.text, "text") + self.assertEqual(ex.details, ("details",)) + class Structures(unittest.TestCase): def test_struct_by_value(self):