Add mock test coverage for LLMTranslator (make_chunks + translate) - #78
Merged
Merged
Conversation
Collaborator
Author
|
There will be at least 2-3 additional PRs coming to refine the translation tests. Solid test coverage is a prerequisite for us to proceed with the refactoring safely and smoothly. |
Owner
|
thanks for your pr! |
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.
Add
tests/test_llm_translator.pywith comprehensive unit and mock tests forLLMTranslator, preparing for the issue #59 pipeline decoupling refactor.New tests
TestMakeChunks— 7 pure unit tests (no mocks)test_basic— standard multi-chunk splittest_exact_fit— texts exactly fill one chunktest_merge_small_tail— small trailing chunk merged into previoustest_no_merge_large_tail— large trailing chunk kept separatetest_empty— empty inputtest_single_item— single texttest_line_numbers— line numbers start at 1 and increment continuously across chunksTestLLMTranslatorTranslate— 6 mock tests (no API calls)test_single_chunk— texts fitting in one chunk, translate_chunk called oncetest_multiple_chunks— texts spanning 2 chunks, translate_chunk called twicetest_context_passing_between_chunks— summary from chunk N appears in chunk N+1's contexttest_length_mismatch_triggers_atomic— wrong-length translation triggers atomic_translate fallbacktest_retry_agent_used_on_primary_failure— primary agent failure activates retry agenttest_resume_from_compare_file— translation resumes from saved intermediate JSON, skipping completed chunksAll tests mock
ChunkedTranslatorAgentandContextReviewerAgentto avoid real API calls.