mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Merged revisions 81294 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81294 | giampaolo.rodola | 2010-05-18 22:04:31 +0200 (mar, 18 mag 2010) | 1 line Fix issue #8573 (asyncore._strerror bug): fixed os.strerror typo; included NameError in the tuple of expected exception; added test case for asyncore._strerror. ........
This commit is contained in:
parent
8fddc9e788
commit
82e02b5876
2 changed files with 11 additions and 2 deletions
|
@ -6,6 +6,7 @@ import socket
|
|||
import sys
|
||||
import time
|
||||
import warnings
|
||||
import errno
|
||||
|
||||
from test import support
|
||||
from test.support import TESTFN, run_unittest, unlink
|
||||
|
@ -324,6 +325,14 @@ class DispatcherTests(unittest.TestCase):
|
|||
self.assertTrue(len(w) == 1)
|
||||
self.assertTrue(issubclass(w[0].category, DeprecationWarning))
|
||||
|
||||
def test_strerror(self):
|
||||
# refers to bug #8573
|
||||
err = asyncore._strerror(errno.EPERM)
|
||||
if hasattr(os, 'strerror'):
|
||||
self.assertEqual(err, os.strerror(errno.EPERM))
|
||||
err = asyncore._strerror(-1)
|
||||
self.assertTrue("unknown error" in err.lower())
|
||||
|
||||
|
||||
class dispatcherwithsend_noread(asyncore.dispatcher_with_send):
|
||||
def readable(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue