Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: ee01a5e5199e2fb13496facec18c3de0db35fe8a authored by cvs2svn on 13 July 2001, 15:10:55 UTC
This commit was manufactured by cvs2svn to create tag 'r211c1'.
Tip revision: ee01a5e
test_grp.py
#! /usr/bin/env python
"""Test script for the grp module
   Roger E. Masse
"""

import grp
from test_support import verbose

groups = grp.getgrall()
if verbose:
    print 'Groups:'
    for group in groups:
        print group

if not groups:
    if verbose:
        print "Empty Group Database -- no further tests of grp module possible"
else:
    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)
back to top