]> granicus.if.org Git - python/commitdiff
Added test_errno to the test suite
authorRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>
Mon, 16 Dec 1996 20:20:33 +0000 (20:20 +0000)
committerRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>
Mon, 16 Dec 1996 20:20:33 +0000 (20:20 +0000)
Lib/test/test_errno.py [new file with mode: 0755]
Lib/test/testall.py

diff --git a/Lib/test/test_errno.py b/Lib/test/test_errno.py
new file mode 100755 (executable)
index 0000000..d248fff
--- /dev/null
@@ -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
index c9470cde4d1efa015cb4357e88ef5d910ac3b70e..87bbc94e3301822c6a36210f73045218c489374d 100644 (file)
@@ -22,6 +22,7 @@ tests = ['test_grammar',
         'test_select',
         'test_strftime',
         'test_struct',
+        'test_errno',
         ]
 
 if __name__ == '__main__':