MCPcopy
hub / github.com/celery/celery / test_check_privileges_without_c_force_root

Function test_check_privileges_without_c_force_root

t/unit/utils/test_platforms.py:900–911  ·  view source on GitHub ↗
(os_module, accept_content)

Source from the content-addressed store, hash-verified

898])
899@patch('celery.platforms.os')
900def test_check_privileges_without_c_force_root(os_module, accept_content):
901 os_module.environ = {}
902 os_module.getuid.return_value = 0
903 os_module.getgid.return_value = 0
904 os_module.geteuid.return_value = 0
905 os_module.getegid.return_value = 0
906
907 expected_message = re.escape(ROOT_DISALLOWED.format(uid=0, euid=0,
908 gid=0, egid=0))
909 with pytest.raises(SecurityError,
910 match=expected_message):
911 check_privileges(accept_content)
912
913
914@fails_on_win32

Callers

nothing calls this directly

Calls 3

check_privilegesFunction · 0.90
formatMethod · 0.45
raisesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…