mirror of
https://github.com/python/cpython.git
synced 2024-11-25 19:03:49 +08:00
f785042433
'verify' iff it's used by a test module...
26 lines
591 B
Python
Executable File
26 lines
591 B
Python
Executable File
#! /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)
|