[Python-checkins] r56349 - python/trunk/Lib/ctypes/test/test_win32.py

thomas.heller python-checkins at python.org
Fri Jul 13 16:18:06 CEST 2007


Author: thomas.heller
Date: Fri Jul 13 16:18:06 2007
New Revision: 56349

Modified:
   python/trunk/Lib/ctypes/test/test_win32.py
Log:
Add tests for _ctypes.COMError.

Modified: python/trunk/Lib/ctypes/test/test_win32.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_win32.py	(original)
+++ python/trunk/Lib/ctypes/test/test_win32.py	Fri Jul 13 16:18:06 2007
@@ -58,6 +58,15 @@
             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):


More information about the Python-checkins mailing list