-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sweep: Write unit tests for ClonedRepo #2377
Comments
Here's the PR! #2378.💎 Sweep Pro: I'm creating this ticket using GPT-4. You have unlimited GPT-4 tickets.
Actions (click)
Step 1: 🔎 SearchingI found the following snippets in your repository. I will now analyze these snippets and come up with a plan. Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.sweep/tests/archive/test_section_rewrite.py Lines 148 to 248 in 67d3ebb
sweep/tests/jsons/landing_page_issue_webhook.json Lines 65 to 145 in 67d3ebb
sweep/sweepai/core/vector_db.py Lines 141 to 247 in 67d3ebb
sweep/sweepai/core/vector_db.py Lines 293 to 387 in 67d3ebb
Step 2: ⌨️ Coding
Create sweepai/utils/github_utils_test.py with contents:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox:
The following are the logs from running the sandbox: Step 3: 🔁 Code ReviewI have finished reviewing the code for completeness. I did not find errors for 🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. |
## Description This PR adds unit tests for the `ClonedRepo` class in the `sweepai/utils/github_utils.py` file. The `ClonedRepo` class is responsible for various operations related to cloning a GitHub repository, listing its directory tree, getting file contents, and more. The added unit tests ensure that these functionalities are working as expected. The tests have been added in a new file `sweepai/utils/github_utils_test.py`. Each method in the `ClonedRepo` class has a corresponding test case. Mocking is used to isolate the `ClonedRepo` class and its methods for testing. ## Summary of Changes - Created a new file `sweepai/utils/github_utils_test.py` for the unit tests. - Added a `TestClonedRepo` class that contains all the unit tests for the `ClonedRepo` class. - For each method in the `ClonedRepo` class, a corresponding test method has been added in the `TestClonedRepo` class. - Used `unittest.mock` to create mock objects and patch external resources as needed. Fixes #2377. --- ### 🎉 Latest improvements to Sweep: * Sweep can now passively improve your repository! Check out [Rules](https://docs.sweep.dev/usage/config#rules) to learn more. --- ### 💡 To get Sweep to edit this pull request, you can: * Comment below, and Sweep can edit the entire PR * Comment on a file, Sweep will only modify the commented file * Edit the original issue to get Sweep to recreate the PR from scratch --------- Co-authored-by: sweep-nightly[bot] <131841235+sweep-nightly[bot]@users.noreply.github.com>
Details
No response
Checklist
sweepai/utils/github_utils_test.py
✅ Commit0ded79e
sweepai/utils/github_utils_test.py
❌ Sandbox failed so I made additional changessweepai/utils/github_utils_test.py
✅ Sandbox ran successfullysweepai/utils/github_utils_test.py
✅ Sandbox ran successfullyThe text was updated successfully, but these errors were encountered: