MCPcopy Index your code
hub / github.com/python/cpython / test_chown_with_root

Method test_chown_with_root

Lib/test/test_os/test_os.py:2260–2268  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2258 @requires_root_user
2259 @unittest.skipUnless(len(all_users) > 1, "test needs more than one user")
2260 def test_chown_with_root(self):
2261 uid_1, uid_2 = all_users[:2]
2262 gid = os.stat(os_helper.TESTFN).st_gid
2263 os.chown(os_helper.TESTFN, uid_1, gid)
2264 uid = os.stat(os_helper.TESTFN).st_uid
2265 self.assertEqual(uid, uid_1)
2266 os.chown(os_helper.TESTFN, uid_2, gid)
2267 uid = os.stat(os_helper.TESTFN).st_uid
2268 self.assertEqual(uid, uid_2)
2269
2270 @requires_non_root_user
2271 @unittest.skipUnless(len(all_users) > 1, "test needs and more than one user")

Callers

nothing calls this directly

Calls 3

chownMethod · 0.80
statMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected