summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_grp.py
blob: 122f2fd8f3e9c06f2008ace2ffb674e3e8fe25c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)