diff --git a/tests/tools/test_file_operations.py b/tests/tools/test_file_operations.py index 472fd8cb8f3..bc3b6c4542f 100644 --- a/tests/tools/test_file_operations.py +++ b/tests/tools/test_file_operations.py @@ -561,28 +561,6 @@ class _DeletedTestGitBaselineCheck: class TestAtomicWriteNewFilePermissions: """_atomic_write should apply umask-default perms to new files (not 0600).""" - def test_generated_script_contains_umask_else_branch(self): - """The shell script should contain the umask-computed chmod for new files.""" - mock = MagicMock() - mock.cwd = "/tmp" - ops = ShellFileOperations(mock) - # _atomic_write is private; exercise it via write_file which delegates - result = ops.write_file("/tmp/nonexistent/new_file.txt", "hello") - # The mock always returns success, but we captured the generated script - script = mock.execute.call_args[0][0] - assert "else" in script, ( - "Expected 'else' branch for new-file mode, got:\n" + script - ) - assert "umask" in script, ( - "Expected 'umask' call in else branch, got:\n" + script - ) - assert "(0666 & ~0" in script, ( - "Expected umask-computed mode in else branch, got:\n" + script - ) - assert "chmod" in script, ( - "Expected chmod of computed mode in else branch, got:\n" + script - ) - def test_new_file_gets_umask_default_permissions(self, tmp_path): """Newly created file should get umask-computed perms, not mktemp's 0600.