Sweep: Add tests for context agent #3492
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces unit tests for the context agent within the SweepAI project, specifically targeting the
context_pruning.py
module. It aims to ensure the reliability and correctness of the context agent's functionality, particularly in handling function calls and retrieving relevant context for given queries.Summary
MagicMock
andpatch
fromunittest.mock
to mock dependencies and function calls during testing.handle_function_call
to verify that it correctly processes a function call, modifies the repository context manager as expected, and asserts the success of the operation.get_relevant_context
to ensure it accurately retrieves and returns the relevant context snippets for a given query by mocking thecontext_dfs
function and asserting the correct snippets are returned.sweepai/core/context_pruning.py
module.Fixes #3491.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.