MCPcopy Create free account
hub / github.com/python/cpython / test_chown_without_permission

Method test_chown_without_permission

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

Source from the content-addressed store, hash-verified

2270 @requires_non_root_user
2271 @unittest.skipUnless(len(all_users) > 1, "test needs and more than one user")
2272 def test_chown_without_permission(self):
2273 uid_1, uid_2 = all_users[:2]
2274 gid = os.stat(os_helper.TESTFN).st_gid
2275 with self.assertRaises(PermissionError):
2276 os.chown(os_helper.TESTFN, uid_1, gid)
2277 os.chown(os_helper.TESTFN, uid_2, gid)
2278
2279 @classmethod
2280 def tearDownClass(cls):

Callers

nothing calls this directly

Calls 3

chownMethod · 0.80
statMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected