summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pwd.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1996-12-23 23:39:42 (GMT)
committerBarry Warsaw <barry@python.org>1996-12-23 23:39:42 (GMT)
commit5e056bbb76bec655f447fd44367f88e33af3bb02 (patch)
tree82093cea175335a37d441cad361b79be6fbb743c /Lib/test/test_pwd.py
parentaeb207c6b69a0efaab686d5257be6fe1dfe2a179 (diff)
downloadcpython-5e056bbb76bec655f447fd44367f88e33af3bb02.zip
cpython-5e056bbb76bec655f447fd44367f88e33af3bb02.tar.gz
cpython-5e056bbb76bec655f447fd44367f88e33af3bb02.tar.bz2
test_rotor.py: New test of the rotor module.
test_*: converted to the new test harness. GvR note! test_signal.py works interatively (i.e. when verbose=1) but does not work inside the test harness. It must be a timing issue, but I haven't figured it out yet.
Diffstat (limited to 'Lib/test/test_pwd.py')
-rw-r--r--Lib/test/test_pwd.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index b182d02..1c2208d 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -1,10 +1,8 @@
+from test_support import verbose
import pwd
import string
-verbose = 0
-if __name__ == '__main__':
- verbose = 1
-
+print 'pwd.getpwall()'
entries = pwd.getpwall()
for e in entries:
@@ -12,12 +10,16 @@ for e in entries:
uid = e[2]
if verbose:
print name, uid
+ print 'pwd.getpwuid()'
dbuid = pwd.getpwuid(uid)
if dbuid[0] <> name:
print 'Mismatch in pwd.getpwuid()'
+ print 'pwd.getpwnam()'
dbname = pwd.getpwnam(name)
if dbname[2] <> uid:
print 'Mismatch in pwd.getpwnam()'
+ else:
+ print 'name matches uid'
break
# try to get some errors
@@ -53,7 +55,7 @@ while bynames.has_key(fakename):
try:
pwd.getpwnam(fakename)
except KeyError:
- pass
+ print 'caught expected exception'
else:
print 'fakename', fakename, 'did not except pwd.getpwnam()'
@@ -65,6 +67,6 @@ fakeuid = uids[0] + 1
try:
pwd.getpwuid(fakeuid)
except KeyError:
- pass
+ print 'caught expected exception'
else:
print 'fakeuid', fakeuid, 'did not except pwd.getpwuid()'