test: add unit tests for zep_paging module#564
Open
JiayuuWang wants to merge 3 commits into
Open
Conversation
When the LLM generates a <tool_call> block followed by a self-generated <tool_result> block in the same response, the fake result must be stripped before appending to message history. The real tool result will be injected separately by the system. This fixes a React Hallucination bug where models could fabricate tool results that didn't actually come from tool invocations.
- Added pytest.ini configuration for test discovery - Added tests/__init__.py package marker - Added 22 unit tests covering: - _read_text_with_fallback: UTF-8, GBK, Latin-1, replacement chars - FileParser: extensions, nonexistent file, unsupported format, md/txt extraction - FileParser.extract_from_multiple: valid files and error handling - split_text_into_chunks: short text, empty text, chunk size, overlap, sentence boundaries All tests pass with direct module import to avoid Flask initialization issues. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add comprehensive tests for fetch_all_nodes and fetch_all_edges functions: - Test success on first attempt - Test retry behavior on transient errors - Test max_retries exhaustion - Test pagination with uuid_cursor - Test max_items limit enforcement - Test missing uuid field handling - Test page_size parameter Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
backend/app/utils/zep_paging.pyfetch_all_nodesandfetch_all_edgesfunctionsTest Coverage
Test Plan
python -m pytest tests/test_zep_paging.py -v- all 15 tests pass🤖 Generated with Claude Code