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

Method test_chown_gid

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

Source from the content-addressed store, hash-verified

2036
2037 @unittest.skipUnless(hasattr(os, 'getgroups'), 'need os.getgroups')
2038 def test_chown_gid(self):
2039 groups = os.getgroups()
2040 if len(groups) < 2:
2041 self.skipTest("test needs at least 2 groups")
2042
2043 gid_1, gid_2 = groups[:2]
2044 uid = os.stat(os_helper.TESTFN).st_uid
2045
2046 os.chown(os_helper.TESTFN, uid, gid_1)
2047 gid = os.stat(os_helper.TESTFN).st_gid
2048 self.assertEqual(gid, gid_1)
2049
2050 os.chown(os_helper.TESTFN, uid, gid_2)
2051 gid = os.stat(os_helper.TESTFN).st_gid
2052 self.assertEqual(gid, gid_2)
2053
2054 @unittest.skipUnless(root_in_posix and len(all_users) > 1,
2055 "test needs root privilege and more than one user")

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
skipTestMethod · 0.80
chownMethod · 0.80
statMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected