summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2007-07-13 14:18:06 (GMT)
committerThomas Heller <theller@ctypes.org>2007-07-13 14:18:06 (GMT)
commit1fd1cc5be28cdf13758ead4a28a63e871ebad91d (patch)
treeede120563b70f2019a7f094c06d156454f1b47da /Lib
parent1421b001625b1108d4c8899c821acf8bf444f714 (diff)
downloadcpython-1fd1cc5be28cdf13758ead4a28a63e871ebad91d.zip
cpython-1fd1cc5be28cdf13758ead4a28a63e871ebad91d.tar.gz
cpython-1fd1cc5be28cdf13758ead4a28a63e871ebad91d.tar.bz2
Add tests for _ctypes.COMError.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/ctypes/test/test_win32.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/ctypes/test/test_win32.py b/Lib/ctypes/test/test_win32.py
index 057873c..5067b60 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):