From d10218f0c8c14e238f43c28e4e0e57693088a9c6 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Mon, 21 Apr 2025 12:28:18 +0200 Subject: [PATCH] Remove useless test --- aider_gitea/__init__.py | 2 +- test/test_solve_issue_in_repository.py | 101 ------------------------- 2 files changed, 1 insertion(+), 102 deletions(-) delete mode 100644 test/test_solve_issue_in_repository.py diff --git a/aider_gitea/__init__.py b/aider_gitea/__init__.py index c458c6b..f205943 100644 --- a/aider_gitea/__init__.py +++ b/aider_gitea/__init__.py @@ -152,7 +152,7 @@ AIDER_LINT = bash_cmd( LLM_MESSAGE_FORMAT = """{issue}\nDo not wait for explicit approval before working on code changes.""" #CODE_MODEL = 'ollama/gemma3:4b' -CODE_MODEL = None +CODE_MODEL = 'o3' EVALUATOR_MODEL = 'ollama/gemma3:27b' def create_aider_command(issue: str) -> list[str]: diff --git a/test/test_solve_issue_in_repository.py b/test/test_solve_issue_in_repository.py deleted file mode 100644 index 4091d28..0000000 --- a/test/test_solve_issue_in_repository.py +++ /dev/null @@ -1,101 +0,0 @@ -from pathlib import Path -from unittest.mock import MagicMock, patch - -from aider_gitea import IssueResolution, RepositoryConfig, solve_issue_in_repository - -REPOSITORY_CONFIG = RepositoryConfig( - gitea_url='https://gitea.example.com', - owner='test-owner', - repo='test-repo', - base_branch='main', -) - - -class TestSolveIssueInRepository: - def setup_method(self): - self.gitea_client = MagicMock() - self.tmpdirname = Path('/tmp/test-repo') - self.branch_name = 'issue-123-test-branch' - self.issue_title = 'Test Issue' - self.issue_description = 'This is a test issue' - self.issue_number = '123' - - @patch('aider_gitea.secrets.llm_api_keys', return_value='fake-api-key') - @patch('aider_gitea.run_cmd') - @patch('aider_gitea.push_changes') - @patch('subprocess.run') - def test_solve_issue_with_aider_changes( - self, - mock_subprocess_run, - mock_push_changes, - mock_run_cmd, - mock_llm_api_key, - ): - # Setup mocks - mock_run_cmd.return_value = True - mock_push_changes.return_value = IssueResolution( - True, - '456', - 'https://gitea.example.com/test-owner/test-repo/pulls/456', - ) - - # Mock subprocess.run to return different commit hashes and file changes - mock_subprocess_run.side_effect = [ - MagicMock(stdout='abc123\n', returncode=0), # First git rev-parse - MagicMock( - stdout='file1.py\nfile2.py\n', - returncode=0, - ), # git diff with changes - ] - - # Call the function - result = solve_issue_in_repository( - REPOSITORY_CONFIG, - self.tmpdirname, - self.branch_name, - self.issue_title, - self.issue_description, - self.issue_number, - self.gitea_client, - ) - - # Verify results - assert result.success is True - assert mock_run_cmd.call_count >= 8 # Verify all expected commands were run - mock_push_changes.assert_called_once() - - @patch('aider_gitea.secrets.llm_api_keys', return_value='fake-api-key') - @patch('aider_gitea.run_cmd') - @patch('aider_gitea.push_changes') - @patch('subprocess.run') - def test_solve_issue_without_aider_changes( - self, - mock_subprocess_run, - mock_push_changes, - mock_run_cmd, - mock_llm_api_key, - ): - # Setup mocks - mock_run_cmd.return_value = True - mock_push_changes.return_value = IssueResolution(False, None, None) - - # Mock subprocess.run to return same commit hash and no file changes - mock_subprocess_run.side_effect = [ - MagicMock(stdout='abc123\n', returncode=0), # First git rev-parse - MagicMock(stdout='', returncode=0), # git diff with no changes - ] - - # Call the function - result = solve_issue_in_repository( - REPOSITORY_CONFIG, - self.tmpdirname, - self.branch_name, - self.issue_title, - self.issue_description, - self.issue_number, - self.gitea_client, - ) - - # Verify results - assert result.success is False - assert mock_push_changes.call_count == 0 # push_changes should not be called