Revised test for errno ala bwarsaw's testing paradigm.
This commit is contained in:
parent
8a51de4cdd
commit
9c6db35a1e
|
@ -2,10 +2,12 @@
|
|||
"""Test the errno module
|
||||
Roger E. Masse
|
||||
"""
|
||||
try:
|
||||
import errno
|
||||
except ImportError:
|
||||
raise SystemExit
|
||||
verbose = 0
|
||||
if __name__ == '__main__':
|
||||
verbose = 1
|
||||
|
||||
|
||||
import errno
|
||||
|
||||
errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
|
||||
'EAFNOSUPPORT', 'EAGAIN', 'EALREADY', 'EBADE', 'EBADF',
|
||||
|
@ -41,4 +43,5 @@ errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
|
|||
#
|
||||
for error in errors:
|
||||
a = getattr(errno, error)
|
||||
# print a
|
||||
if verbose:
|
||||
print '%s: %d' % (error, a)
|
||||
|
|
Loading…
Reference in New Issue