Commit graph

662 commits

Author SHA1 Message Date
Paul Gauthier
f696d0933f fix: Update test_lint_option to handle dirty file in root directory 2024-08-01 16:58:50 -03:00
Paul Gauthier (aider)
bb279d6899 feat: Add test for --lint option 2024-08-01 16:42:12 -03:00
Paul Gauthier (aider)
1a3221e400 fix: Remove unused import of InputOutput from aider.io 2024-08-01 15:46:59 -03:00
Paul Gauthier
1d875cc5f0 fix: Remove unnecessary assertions in test_scripting.py 2024-08-01 15:46:53 -03:00
Paul Gauthier (aider)
d2dc79978e style: Fix linter issues in test_scripting.py 2024-08-01 15:44:58 -03:00
Paul Gauthier (aider)
a4b6dea54d feat: use GitTemporaryDirectory for scripting tests 2024-08-01 15:44:55 -03:00
Paul Gauthier
99ce27f151 fix: Set partial_response_function_call to None in mock_send_side_effect 2024-08-01 15:44:54 -03:00
Paul Gauthier (aider)
bde6bb5c18 style: format code with linter 2024-08-01 15:42:48 -03:00
Paul Gauthier (aider)
96940a319a fix: Handle functions argument in test mocks 2024-08-01 15:42:44 -03:00
Paul Gauthier
8a6f1337f6 fix: Move mock_send_side_effect definition before its usage 2024-08-01 15:42:43 -03:00
Paul Gauthier (aider)
58a732312b fix: Remove unused import of MagicMock 2024-08-01 15:40:45 -03:00
Paul Gauthier (aider)
f23c1c94fa style: format code 2024-08-01 15:40:25 -03:00
Paul Gauthier (aider)
830868605b fix: Set coder.partial_response_content in mocked send() method 2024-08-01 15:40:23 -03:00
Paul Gauthier (aider)
82a0e5ec40 style: format code to improve readability 2024-08-01 15:37:37 -03:00
Paul Gauthier (aider)
4eb8be9d06 fix: Mock Coder.send() instead of Coder.create and Model 2024-08-01 15:37:34 -03:00
Paul Gauthier (aider)
b29a6e8fa4 style: Format Python code with black 2024-08-01 15:36:29 -03:00
Paul Gauthier (aider)
a480b90217 feat: add unit tests for Python scripting API 2024-08-01 15:36:26 -03:00
Paul Gauthier
f7d0f0c604 feat: Add basic scripting tests 2024-08-01 15:36:24 -03:00
Paul Gauthier
aad52eaae2 fix: Update Coder import path in test_main.py 2024-08-01 15:32:39 -03:00
Paul Gauthier
387b2710b0 fix: Refactor Coder creation to use GitRepo instance 2024-08-01 15:30:49 -03:00
Paul Gauthier
283ac13d2c Fix tests to use new GitRepo 2024-08-01 15:25:31 -03:00
Paul Gauthier (aider)
5bfedea9ff feat: update test to correctly access message content
The test for `test_get_commit_message_with_custom_prompt` has been updated to correctly access the message content from the positional arguments of the `simple_send_with_retries` function call. This ensures that the test accurately reflects the implementation in the `GitRepo` class.
2024-07-31 09:51:28 -03:00
Paul Gauthier
2212613c47 feat(repo): add support for multiple models in get_commit_message 2024-07-31 09:51:26 -03:00
Paul Gauthier (aider)
7d2f184b36 feat: add tests for commit_prompt functionality
The new test case `test_get_commit_message_with_custom_prompt` ensures that when a custom `commit_prompt` is provided to the `GitRepo` constructor, it's used instead of the default prompt when generating commit messages. The test checks that:

1. The custom commit prompt is passed correctly to the `simple_send_with_retries` function.
2. The returned commit message is as expected.
3. The `simple_send_with_retries` function is called only once (since we're using a single model).

This new test case, along with the existing `test_get_commit_message_no_strip_unmatched_quotes` test, provides better coverage for the `get_commit_message` method in the `GitRepo` class.
2024-07-31 09:50:34 -03:00
Paul Gauthier
4a3ea08b49 Add OCaml test case for repomap 2024-07-30 15:03:54 -03:00
Paul Gauthier (aider)
0980985338 Add fallback to second model when first model fails in ChatSummary 2024-07-30 12:16:32 -03:00
Paul Gauthier (aider)
b9b04052c7 Modify the test to check if the linter was called with a filename string whose Path().name matches the expected filename. 2024-07-30 10:10:39 -03:00
Paul Gauthier
33d9f46e25 Add unit test to verify cmd_lint calls linter with correct filename 2024-07-30 10:10:37 -03:00
Paul Gauthier
5edce8ae1b Add linter output to the dump for debugging 2024-07-29 20:28:43 -03:00
Paul Gauthier (aider)
122eb8834a Normalize file paths to resolve symbolic links in macOS when comparing absolute file names between coders. 2024-07-29 17:26:14 -03:00
Paul Gauthier
7baa4a802e Add test to ensure abs_fnames contain unique and correct paths 2024-07-29 17:26:12 -03:00
Paul Gauthier (aider)
78e7b0b922 Use a more specific assertion method in the test case 2024-07-29 17:17:50 -03:00
Paul Gauthier (aider)
d4f5330f55 Fix typo in assertion for "I ran this command" 2024-07-29 17:17:31 -03:00
Paul Gauthier
11facfe4d5 Add test for cmd_run method to handle unbound local error 2024-07-29 17:17:29 -03:00
Paul Gauthier (aider)
23a9ade113 Modify the test to ensure cmd_run returns without errors 2024-07-29 17:10:09 -03:00
Paul Gauthier (aider)
c8e5c27a2f Add a test to trigger the UnboundLocalError bug in the cmd_run method
Commit message: Add test to trigger UnboundLocalError in cmd_run method
2024-07-29 17:07:51 -03:00
Paul Gauthier
b69bf02115 Refactor Coder creation to use file name instead of string representation 2024-07-29 17:05:20 -03:00
Paul Gauthier (aider)
775dd9e6b8 Create a new file in a subdirectory of a git repository, then create a Coder instance from that file and another Coder instance from the first one, ensuring both have the same set of absolute file names. 2024-07-29 16:57:19 -03:00
Paul Gauthier
149db2e5fe Add test for creating a Coder from another Coder with a subdirectory 2024-07-29 16:57:16 -03:00
Paul Gauthier (aider)
0a61e83c2b Fix the test_cmd_lint_with_dirty_file test to handle the MagicMock object returned by the lint method. 2024-07-29 16:46:56 -03:00
Paul Gauthier (aider)
24c8363aa8 Fix unused import of unittest in tests/basic/test_commands.py 2024-07-29 16:45:59 -03:00
Paul Gauthier
f90cd6b69b Add unit tests for the cmd_lint command 2024-07-29 16:45:57 -03:00
Paul Gauthier (aider)
cf35c2db4e Fix the test_cmd_lint_with_dirty_file test to use mocking instead of captured output 2024-07-29 16:45:21 -03:00
Paul Gauthier
bb7465e05d Modify test_commands.py to mock linter.lint method and assert it was called with the dirty file 2024-07-29 16:45:18 -03:00
Paul Gauthier (aider)
894eff4393 Add a test that checks if the cmd_lint command correctly identifies a dirty file in a repository. 2024-07-29 16:30:08 -03:00
Paul Gauthier (aider)
f04fb8d53a Add a test for get_commit_message that initializes a GitRepo with two models and ensures the commit message is correctly retrieved from the second model. 2024-07-28 17:13:35 -03:00
Paul Gauthier
8a9184cef9 Fix tests for check_for_urls 2024-07-28 16:48:59 -03:00
Paul Gauthier (aider)
a0eadb62c5 Add test case for check_for_urls to handle repeated URLs 2024-07-28 16:40:39 -03:00
Paul Gauthier
bb86fed9f6 disable ocaml test for now, until fixed 2024-07-24 09:41:25 +02:00
Paul Gauthier (aider)
9db28c0052 Added a new test case to ensure the RepoMap class can handle and include files from all supported languages. 2024-07-24 09:24:52 +02:00