summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2010-12-14 16:20:53 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2010-12-14 16:20:53 (GMT)
commitec07331eea496469165dc3be45fadbeab641e083 (patch)
tree3961e67fea53d641e0aa587db146fb4ab40b623e /Lib/test
parenta80f4fb0481237e4ca4a9d9a57c52e0181b638f9 (diff)
downloadcpython-ec07331eea496469165dc3be45fadbeab641e083.zip
cpython-ec07331eea496469165dc3be45fadbeab641e083.tar.gz
cpython-ec07331eea496469165dc3be45fadbeab641e083.tar.bz2
#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 dafd905..04a8af6 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)