MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_chown_with_root

Method test_chown_with_root

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

Source from the content-addressed store, hash-verified

2054 @unittest.skipUnless(root_in_posix and len(all_users) > 1,
2055 "test needs root privilege and more than one user")
2056 def test_chown_with_root(self):
2057 uid_1, uid_2 = all_users[:2]
2058 gid = os.stat(os_helper.TESTFN).st_gid
2059 os.chown(os_helper.TESTFN, uid_1, gid)
2060 uid = os.stat(os_helper.TESTFN).st_uid
2061 self.assertEqual(uid, uid_1)
2062 os.chown(os_helper.TESTFN, uid_2, gid)
2063 uid = os.stat(os_helper.TESTFN).st_uid
2064 self.assertEqual(uid, uid_2)
2065
2066 @unittest.skipUnless(not root_in_posix and len(all_users) > 1,
2067 "test needs non-root account 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