From: Roger E. Masse Date: Wed, 18 Dec 1996 19:36:34 +0000 (+0000) Subject: Test script for the UNIX group file access module (grp) X-Git-Tag: v1.5a1~704 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=749cc6b2411ecc898badf597b8554abb845e7f74;p=thirdparty%2FPython%2Fcpython.git Test script for the UNIX group file access module (grp) --- diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py new file mode 100755 index 000000000000..122f2fd8f3e9 --- /dev/null +++ b/Lib/test/test_grp.py @@ -0,0 +1,24 @@ +#! /usr/bin/env python +"""Test script for the grp module + Roger E. Masse +""" +verbose = 0 +if __name__ == '__main__': + verbose = 1 + +import grp + +groups = grp.getgrall() +if verbose: + print 'Groups:' + for group in groups: + print group + + +group = grp.getgrgid(groups[0][2]) +if verbose: + print 'Group Entry for GID %d: %s' % (groups[0][2], group) + +group = grp.getgrnam(groups[0][0]) +if verbose: + print 'Group Entry for group %s: %s' % (groups[0][0], group) diff --git a/Lib/test/testall.py b/Lib/test/testall.py index 62b16a4295d2..318ab4c871ce 100644 --- a/Lib/test/testall.py +++ b/Lib/test/testall.py @@ -28,6 +28,7 @@ tests = ['test_grammar', 'test_xdr', 'test_fcntl', 'test_gdbm', + 'test_grp', ] if __name__ == '__main__':