import subprocess from dataclasses import replace from pathlib import Path from unittest.mock import Mock import pytest from lai_automation.git import GitWorkspace from lai_automation.models import ChangeSummary def test_normalize_changed_whitespace_cleans_new_text_file( settings, tmp_path: Path, ) -> None: workspace = GitWorkspace(replace(settings, workspace_root=tmp_path), 1) workspace.path.mkdir(parents=True) changed = workspace.path / "new.php" changed.write_bytes(b" None: workspace = GitWorkspace(replace(settings, workspace_root=tmp_path), 1) workspace.path.mkdir(parents=True) changed = workspace.path / "tracked.php" changed.write_bytes(b" None: workspace = GitWorkspace(replace(settings, workspace_root=tmp_path), 1) workspace.path.mkdir(parents=True) (workspace.path / "app.php").write_text(" None: workspace = GitWorkspace(replace(settings, workspace_root=tmp_path), 1) workspace.path.mkdir(parents=True) (workspace.path / "app.php").write_text(" None: workspace = GitWorkspace(replace(settings, workspace_root=tmp_path), 1) workspace.path.mkdir(parents=True) (workspace.path / "legacy.php").write_text("