summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-12-14 16:26:30 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-12-14 16:26:30 (GMT)
commitf8a6391991946a3e9ce79dbca1c20aec7596f8e0 (patch)
treed8b4fb284acee33d03da0c4a5ec3c0d997e12079 /Lib/test
parent312efbc1158a15cb877d8bb078c19f95b23596e6 (diff)
downloadcpython-f8a6391991946a3e9ce79dbca1c20aec7596f8e0.zip
cpython-f8a6391991946a3e9ce79dbca1c20aec7596f8e0.tar.gz
cpython-f8a6391991946a3e9ce79dbca1c20aec7596f8e0.tar.bz2
Merged revisions 87238 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87238 | r.david.murray | 2010-12-14 11:20:53 -0500 (Tue, 14 Dec 2010) | 7 lines #775964: skip YP/NIS entries instead of failing the test Also includes doc updates mentioning that these entries may not be retrievable via getgrnam and getgrgid. Patch by Bobby Impollonia. ........
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_grp.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py
index b4701d5..e9e1758 100644
--- a/Lib/test/test_grp.py
+++ b/Lib/test/test_grp.py
@@ -33,12 +33,16 @@ class GroupDatabaseTestCase(unittest.TestCase):
e2 = grp.getgrgid(e.gr_gid)
self.check_value(e2)
self.assertEqual(e2.gr_gid, e.gr_gid)
- e2 = grp.getgrnam(e.gr_name)
+ name = e.gr_name
+ if name.startswith('+') or name.startswith('-'):
+ # NIS-related entry
+ continue
+ e2 = grp.getgrnam(name)
self.check_value(e2)
# There are instances where getgrall() returns group names in
# lowercase while getgrgid() returns proper casing.
# Discovered on Ubuntu 5.04 (custom).
- self.assertEqual(e2.gr_name.lower(), e.gr_name.lower())
+ self.assertEqual(e2.gr_name.lower(), name.lower())
def test_errors(self):
self.assertRaises(TypeError, grp.getgrgid)