summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1996-12-16 20:20:33 (GMT)
committerRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1996-12-16 20:20:33 (GMT)
commit8ba76d3cf38a9aaec3bdea9f13b52d8e8a03915e (patch)
treefc2907c4ecf274a7056910e97bcfc6794553fab5
parent529fcfe31f61fe499564f6778774f61c19671681 (diff)
downloadcpython-8ba76d3cf38a9aaec3bdea9f13b52d8e8a03915e.zip
cpython-8ba76d3cf38a9aaec3bdea9f13b52d8e8a03915e.tar.gz
cpython-8ba76d3cf38a9aaec3bdea9f13b52d8e8a03915e.tar.bz2
Added test_errno to the test suite
-rwxr-xr-xLib/test/test_errno.py44
-rw-r--r--Lib/test/testall.py1
2 files changed, 45 insertions, 0 deletions
diff --git a/Lib/test/test_errno.py b/Lib/test/test_errno.py
new file mode 100755
index 0000000..d248fff
--- /dev/null
+++ b/Lib/test/test_errno.py
@@ -0,0 +1,44 @@
+#! /usr/bin/env python
+"""Test the errno module
+ Roger E. Masse
+"""
+try:
+ import errno
+except ImportError:
+ raise SystemExit
+
+errors = ['E2BIG', 'EACCES', 'EADDRINUSE', 'EADDRNOTAVAIL', 'EADV',
+ 'EAFNOSUPPORT', 'EAGAIN', 'EALREADY', 'EBADE', 'EBADF',
+ 'EBADFD', 'EBADMSG', 'EBADR', 'EBADRQC', 'EBADSLT',
+ 'EBFONT', 'EBUSY', 'ECHILD', 'ECHRNG', 'ECOMM',
+ 'ECONNABORTED', 'ECONNREFUSED', 'ECONNRESET',
+ 'EDEADLK', 'EDEADLOCK', 'EDESTADDRREQ', 'EDOM',
+ 'EDQUOT', 'EEXIST', 'EFAULT', 'EFBIG', 'EHOSTDOWN',
+ 'EHOSTUNREACH', 'EIDRM', 'EILSEQ', 'EINPROGRESS',
+ 'EINTR', 'EINVAL', 'EIO', 'EISCONN', 'EISDIR',
+ 'EL2HLT', 'EL2NSYNC', 'EL3HLT', 'EL3RST', 'ELIBACC',
+ 'ELIBBAD', 'ELIBEXEC', 'ELIBMAX', 'ELIBSCN', 'ELNRNG',
+ 'ELOOP', 'EMFILE', 'EMLINK', 'EMSGSIZE', 'EMULTIHOP',
+ 'ENAMETOOLONG', 'ENETDOWN', 'ENETRESET', 'ENETUNREACH',
+ 'ENFILE', 'ENOANO', 'ENOBUFS', 'ENOCSI', 'ENODATA',
+ 'ENODEV', 'ENOENT', 'ENOEXEC', 'ENOLCK', 'ENOLINK',
+ 'ENOMEM', 'ENOMSG', 'ENONET', 'ENOPKG', 'ENOPROTOOPT',
+ 'ENOSPC', 'ENOSR', 'ENOSTR', 'ENOSYS', 'ENOTBLK',
+ 'ENOTCONN', 'ENOTDIR', 'ENOTEMPTY', 'ENOTSOCK',
+ 'ENOTTY', 'ENOTUNIQ', 'ENXIO', 'EOPNOTSUPP',
+ 'EOVERFLOW', 'EPERM', 'EPFNOSUPPORT', 'EPIPE',
+ 'EPROTO', 'EPROTONOSUPPORT', 'EPROTOTYPE',
+ 'ERANGE', 'EREMCHG', 'EREMOTE', 'ERESTART',
+ 'EROFS', 'ESHUTDOWN', 'ESOCKTNOSUPPORT', 'ESPIPE',
+ 'ESRCH', 'ESRMNT', 'ESTALE', 'ESTRPIPE', 'ETIME',
+ 'ETIMEDOUT', 'ETOOMANYREFS', 'ETXTBSY', 'EUNATCH',
+ 'EUSERS', 'EWOULDBLOCK', 'EXDEV', 'EXFULL']
+
+#
+# This is is a wee bit bogus since the module pnly conditionally adds
+# errno constants if they have been defined by errno.h However, this
+# test seems to work on SGI, Sparc & intel Solaris, and linux.
+#
+for error in errors:
+ a = getattr(errno, error)
+ # print a
diff --git a/Lib/test/testall.py b/Lib/test/testall.py
index c9470cd..87bbc94 100644
--- a/Lib/test/testall.py
+++ b/Lib/test/testall.py
@@ -22,6 +22,7 @@ tests = ['test_grammar',
'test_select',
'test_strftime',
'test_struct',
+ 'test_errno',
]
if __name__ == '__main__':