This commit is contained in:
+12
-12
@@ -137,36 +137,36 @@ async def test_sync_branch_resets_and_cleans_before_returning_sha(
|
||||
assert recorder.calls[0][1]["env"]["AGENTCI_GIT_PASSWORD"] == "secret-token"
|
||||
|
||||
|
||||
async def test_branch_status_and_diff_commands(
|
||||
async def test_local_worktree_commands_and_status_mapping(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
recorder = install_recorder(
|
||||
monkeypatch,
|
||||
[FakeProcess(), FakeProcess(stdout=b" M src/app.py\n"), FakeProcess()],
|
||||
[
|
||||
FakeProcess(),
|
||||
FakeProcess(stdout=b" M src/app.py\n"),
|
||||
FakeProcess(stdout=b" \n"),
|
||||
FakeProcess(),
|
||||
],
|
||||
)
|
||||
workspace = tmp_path / "repo"
|
||||
git = git_client(tmp_path)
|
||||
|
||||
await git.create_branch(workspace, "agent/issue-1")
|
||||
changed = await git.has_changes(workspace)
|
||||
dirty = await git.has_changes(workspace)
|
||||
clean = await git.has_changes(workspace)
|
||||
await git.diff_check(workspace)
|
||||
|
||||
assert changed is True
|
||||
assert dirty is True
|
||||
assert clean is False
|
||||
assert recorder.commands == [
|
||||
("git", "switch", "-c", "agent/issue-1"),
|
||||
("git", "status", "--porcelain"),
|
||||
("git", "status", "--porcelain"),
|
||||
("git", "diff", "--check"),
|
||||
]
|
||||
|
||||
|
||||
async def test_has_changes_is_false_for_clean_status(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
install_recorder(monkeypatch, [FakeProcess(stdout=b"\n")])
|
||||
|
||||
assert await git_client(tmp_path).has_changes(tmp_path / "repo") is False
|
||||
|
||||
|
||||
async def test_commit_stages_all_changes_sets_identity_and_returns_sha(
|
||||
tmp_path: Path, monkeypatch: pytest.MonkeyPatch
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user