(os_module, accept_content)
| 898 | ]) |
| 899 | @patch('celery.platforms.os') |
| 900 | def 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…