(self)
| 2240 | |
| 2241 | @unittest.skipUnless(hasattr(os, 'getgroups'), 'need os.getgroups') |
| 2242 | def test_chown_gid(self): |
| 2243 | groups = os.getgroups() |
| 2244 | if len(groups) < 2: |
| 2245 | self.skipTest("test needs at least 2 groups") |
| 2246 | |
| 2247 | gid_1, gid_2 = groups[:2] |
| 2248 | uid = os.stat(os_helper.TESTFN).st_uid |
| 2249 | |
| 2250 | os.chown(os_helper.TESTFN, uid, gid_1) |
| 2251 | gid = os.stat(os_helper.TESTFN).st_gid |
| 2252 | self.assertEqual(gid, gid_1) |
| 2253 | |
| 2254 | os.chown(os_helper.TESTFN, uid, gid_2) |
| 2255 | gid = os.stat(os_helper.TESTFN).st_gid |
| 2256 | self.assertEqual(gid, gid_2) |
| 2257 | |
| 2258 | @requires_root_user |
| 2259 | @unittest.skipUnless(len(all_users) > 1, "test needs more than one user") |
nothing calls this directly
no test coverage detected