[pywin32-checkins] pywin32/win32/test test_exceptions.py,1.5,1.6
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-11 05:13:11
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28610/win32/test Modified Files: test_exceptions.py Log Message: Move to exception attributes Index: test_exceptions.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_exceptions.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_exceptions.py 7 Oct 2008 11:28:10 -0000 1.5 --- test_exceptions.py 11 Dec 2008 05:13:07 -0000 1.6 *************** *** 42,50 **** win32api.CloseHandle(1) self.fail("expected exception!") ! except win32api.error, (werror, func, msg): ! self.failUnlessEqual(werror, winerror.ERROR_INVALID_HANDLE) ! self.failUnlessEqual(func, "CloseHandle") expected_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() ! self.failUnlessEqual(msg, expected_msg) def testAsStr(self): --- 42,50 ---- win32api.CloseHandle(1) self.fail("expected exception!") ! except win32api.error, exc: ! self.failUnlessEqual(exc.winerror, winerror.ERROR_INVALID_HANDLE) ! self.failUnlessEqual(exc.funcname, "CloseHandle") expected_msg = win32api.FormatMessage(winerror.ERROR_INVALID_HANDLE).rstrip() ! self.failUnlessEqual(exc.strerror, expected_msg) def testAsStr(self): |