Test script for the UNIX group file access module (grp)

This commit is contained in:
Roger E. Masse 1996-12-18 19:36:34 +00:00
parent f90eddef5d
commit 749cc6b241
2 changed files with 25 additions and 0 deletions

24
Lib/test/test_grp.py Executable file
View file

@ -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)

View file

@ -28,6 +28,7 @@ tests = ['test_grammar',
'test_xdr',
'test_fcntl',
'test_gdbm',
'test_grp',
]
if __name__ == '__main__':