summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grp.py
diff options
context:
space:
mode:
authorRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1996-12-18 19:36:34 (GMT)
committerRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1996-12-18 19:36:34 (GMT)
commit749cc6b2411ecc898badf597b8554abb845e7f74 (patch)
tree58e51402b3d633d1274a7acb168549644322d7aa /Lib/test/test_grp.py
parentf90eddef5d3554136623aa81a91187640bf0e92c (diff)
downloadcpython-749cc6b2411ecc898badf597b8554abb845e7f74.zip
cpython-749cc6b2411ecc898badf597b8554abb845e7f74.tar.gz
cpython-749cc6b2411ecc898badf597b8554abb845e7f74.tar.bz2
Test script for the UNIX group file access module (grp)
Diffstat (limited to 'Lib/test/test_grp.py')
-rwxr-xr-xLib/test/test_grp.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py
new file mode 100755
index 0000000..122f2fd
--- /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)