def METHOD_NAME(self):
    entries = pwd.getpwall()
    entriesbyname = {}
    entriesbyuid = {}
    if len(entries) > 1000:  # Huge passwd file (NIS?) -- skip this test
        self.skipTest('passwd file is huge; extended test skipped')
    for e in entries:
        entriesbyname.setdefault(e.pw_name, []).append(e)
        entriesbyuid.setdefault(e.pw_uid, []).append(e)
    # check whether the entry returned by getpwuid()
    # for each uid is among those from getpwall() for this uid
    for e in entries:
        if not e[0] or e[0] == '+':
            continue # skip NIS entries etc.
        self.assertIn(pwd.getpwnam(e.pw_name), entriesbyname[e.pw_name])
        self.assertIn(pwd.getpwuid(e.pw_uid), entriesbyuid[e.pw_uid])