Issue #17248: Fix os.*chown() testing when user has group root.

This commit is contained in:
Serhiy Storchaka 2013-02-20 19:47:31 +02:00
parent 3e188c4ebb
commit fffc479f15

View file

@ -269,10 +269,11 @@ def check_stat(uid, gid):
# 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)