Kaydet (Commit) 0e664e15 authored tarafından Fredrik Lundh's avatar Fredrik Lundh

skip NIS entries, empty entries, etc

üst 80768f86
......@@ -42,6 +42,8 @@ class GroupDatabaseTestCase(unittest.TestCase):
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
......
......@@ -38,8 +38,8 @@ class PwdTest(unittest.TestCase):
# 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])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment