(original) (raw)
changeset: 82279:8c11bbdbac09 parent: 82275:d4bf997a34e9 parent: 82278:96b4acb253f8 user: Serhiy Storchaka storchaka@gmail.com date: Wed Feb 20 19:49:12 2013 +0200 files: Lib/test/test_posix.py description: Issue #17248: Fix os.*chown() testing when user has group root. diff -r d4bf997a34e9 -r 8c11bbdbac09 Lib/test/test_posix.py --- a/Lib/test/test_posix.py Wed Feb 20 19:43:05 2013 +0200 +++ b/Lib/test/test_posix.py Wed Feb 20 19:49:12 2013 +0200 @@ -451,10 +451,11 @@ # non-root cannot chown to root, raises OSError self.assertRaises(OSError, chown_func, first_param, 0, 0) check_stat(uid, gid) - self.assertRaises(OSError, chown_func, first_param, -1, 0) - check_stat(uid, gid) self.assertRaises(OSError, chown_func, first_param, 0, -1) check_stat(uid, gid) + if gid != 0: + self.assertRaises(OSError, chown_func, first_param, -1, 0) + check_stat(uid, gid) # test illegal types for t in str, float: self.assertRaises(TypeError, chown_func, first_param, t(uid), gid) /storchaka@gmail.com