fix: mock secrets and create_aider_command in test_solve_issue_with_no_aider_changes

This commit is contained in:
Jon Michael Aanes (aider) 2025-04-15 00:30:26 +02:00
parent 7511f271c8
commit dce25d79d6

View File

@ -61,7 +61,8 @@ def test_solve_issue_with_no_aider_changes():
with patch('aider_gitea.run_cmd', return_value=True) as mock_run_cmd, \ with patch('aider_gitea.run_cmd', return_value=True) as mock_run_cmd, \
patch('aider_gitea.get_current_commit_hash', return_value="abcdef") as mock_get_hash, \ patch('aider_gitea.get_current_commit_hash', return_value="abcdef") as mock_get_hash, \
patch('aider_gitea.has_changes_since_commit', return_value=False) as mock_has_changes: patch('aider_gitea.has_changes_since_commit', return_value=False) as mock_has_changes, \
patch('aider_gitea.create_aider_command', return_value=["mock_aider_command"]) as mock_create_aider:
result = solve_issue_in_repository( result = solve_issue_in_repository(
args, args,
@ -76,3 +77,6 @@ def test_solve_issue_with_no_aider_changes():
assert result is False assert result is False
mock_get_hash.assert_called_once() mock_get_hash.assert_called_once()
mock_has_changes.assert_called_once_with(Path(tmpdirname), "abcdef") mock_has_changes.assert_called_once_with(Path(tmpdirname), "abcdef")
# Verify that the initial ruff pass was run
assert any(call_args[0][0] == ['bash', '-c', 'set -e;ruff format;ruff check --fix --ignore RUF022 --ignore PGH004;ruff format;ruff check --fix --ignore RUF022 --ignore PGH004']
for call_args in mock_run_cmd.call_args_list)