test(backend): cover the six zero-coverage modules — ratchet moves up#178
Merged
Conversation
Coverage (pytest -m "not paid" --cov=providers --cov=generate): 84.68% -> 85.72% TOTAL; fail_under 83 -> 84 (floor(85.72) - 1). Per target: - providers/video.py: 0% -> 100%. New tests/test_video.py — tier/model precedence ladder, animate_image orchestration with to_fal_url + _fal_subscribe mocked (FAL_KEY guard, LTX-2 string-enum duration snap, Wan num_frames clamp, no-payload/no-url raises, content-type/duration fallbacks), data_url_from_bytes. Video env pins added to conftest _SCRUB. - providers/breaker.py: threshold/close/skip were already pinned in test_provider_fallback.py; added the untested wall-clock leg — cooldown expiry half-opens, failed probe re-opens instantly, good probe clears the count (time.monotonic monkeypatched). - providers/moderation.py: allow/block/off/FAIL-OPEN already pinned in test_deploy_safety.py; added the empty-reason -> "blocked by moderation" default branch. - ltxf.py: new tests/test_ltxf.py — envelope round-trip against the wire layout, short/wrong-magic/truncated-header rejects, split_fmp4 on synthetic boxes incl. 64-bit largesize and size-0 open box, no-moov raise. (Outside the providers+generate cov scope, so no TOTAL effect.) - local_server.py: new tests/test_local_server.py — import smoke with dotenv stubbed (host .env stays out) + modal stubbed; asserts the module re-exports generate.fastapi_app and the expected routes exist. No server start. (Outside cov scope.) - _env.py: already fully covered by tests/test_env_flag.py (truth table, defaults, garbage) — nothing added, duplication avoided. Gates: pytest 84.0% floor reached at 85.72%; ruff clean; mypy clean (46 files).
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
PR C of the coverage campaign. Honest scope note: three of the six "zero-coverage" targets already had tests (breaker's core state machine, moderation's fail-open,
_env's truth table) — this adds only what was missing:_SCRUB).split_fmp4on synthetic boxes incl. 64-bit largesize; local_server.py: import smoke pinning the re-exposed routes (dotenv/modal stubbed).Ratchet: 84.68% → 85.72%,
fail_under83 → 84. Gate output in CI shows the floor being enforced. 953 tests + ruff + mypy green.🤖 Generated with Claude Code