[Python-checkins] commit of r41658 - in python/trunk: Lib/test/test_grp.py Lib/test/test_pwd.py

fredrik.lundh python-checkins at python.org
Mon Dec 12 21:53:40 CET 2005


Author: fredrik.lundh
Date: Mon Dec 12 21:53:40 2005
New Revision: 41658
Modified:
 python/trunk/ (props changed)
 python/trunk/Lib/test/test_grp.py
 python/trunk/Lib/test/test_pwd.py
Log:
skip NIS entries, empty entries, etc
Modified: python/trunk/Lib/test/test_grp.py
==============================================================================
--- python/trunk/Lib/test/test_grp.py	(original)
+++ python/trunk/Lib/test/test_grp.py	Mon Dec 12 21:53:40 2005
@@ -42,6 +42,8 @@
 bynames = {}
 bygids = {}
 for (n, p, g, mem) in grp.getgrall():
+ if not n or n == '+':
+ continue # skip NIS entries etc.
 bynames[n] = g
 bygids[g] = n
 
Modified: python/trunk/Lib/test/test_pwd.py
==============================================================================
--- python/trunk/Lib/test/test_pwd.py	(original)
+++ python/trunk/Lib/test/test_pwd.py	Mon Dec 12 21:53:40 2005
@@ -38,8 +38,8 @@
 # check whether the entry returned by getpwuid()
 # for each uid is among those from getpwall() for this uid
 for e in entries:
- if e[0] == '+':
- continue # skip NIS entries
+ if not e[0] or e[0] == '+':
+ continue # skip NIS entries etc.
 self.assert_(pwd.getpwnam(e.pw_name) in entriesbyname[e.pw_name])
 self.assert_(pwd.getpwuid(e.pw_uid) in entriesbyuid[e.pw_uid])
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /