test: cover report helpers _parse_dedupe_response and litellm routing predicates#597
Open
Rome-1 wants to merge 1 commit into
Open
test: cover report helpers _parse_dedupe_response and litellm routing predicates#597Rome-1 wants to merge 1 commit into
Rome-1 wants to merge 1 commit into
Conversation
Contributor
Greptile SummaryThis PR adds 19 focused offline unit tests for three previously-uncovered pure helpers in
Confidence Score: 5/5Pure test addition with no changes to application code — safe to merge. Both test files are correct against the current source implementations: every parametrized case and assertion was traced through the actual source logic and produces the expected output. No flaky assumptions, no network calls, no mocking gaps. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "test: cover report helpers _parse_dedupe..." | Re-trigger Greptile |
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.
Adds focused unit tests for three previously-uncovered pure helpers in
strix/report/, locking in their string-parsing and routing behavior so future refactors can't silently regress them.tests/test_dedupe_parsing.pyexercisesstrix.report.dedupe._parse_dedupe_response: plain-JSON round-trip,jsonfenced-block unwrapping, theValueError("No JSON object found")path when no object is present,duplicate_idtruncation to 64 chars, and the non-numeric / nullconfidence->0.0fallback.tests/test_usage_helpers.pyparametrizesstrix.report.usage._litellm_model_name(None / "" / whitespace -> None, plain passthrough,litellm/any-llm/openai/prefix stripping,deepseek/preserved) and_is_litellm_routed(None / plain /openai/-> False;deepseek/litellm/any-llm/-> True). The tests are pure and offline — no network, no API keys, no Docker, and litellm is never imported (the helpers operate on strings only). These behaviors had zero direct coverage on main.Testing
pytest tests/test_dedupe_parsing.py tests/test_usage_helpers.py -v-> 19 passed in <2s (no network / LLM / Docker).[:64]->[:32]in dedupe; dropping theopenai/special-case in usage): exactly the corresponding assertions failed, and all 19 passed again once the source was restored.ruff checkclean;bandit -c pyproject.tomlclean;pyupgrade --py310-plusno changes. Note: the repo's pinned pre-commit mypy hook crashes with an internal error on the bundled openai SDK onmainas well, so mypy was not run as a gate here; these test files add no new typing surface.