Skip to content

tests: add unit tests for TogetherImageProvider#3049

Merged
Salazareo merged 1 commit into
mainfrom
DS/2987
May 9, 2026
Merged

tests: add unit tests for TogetherImageProvider#3049
Salazareo merged 1 commit into
mainfrom
DS/2987

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Mocks the together-ai SDK at the module boundary, boots a real PuterServer for the wired MeteringService, and exercises construction (missing-key throw), model catalog (default + verbatim list), test_mode bypass, prompt validation, the credit gate (402 before SDK), all three pricing branches (per-MP × ratio, per-image, per-tier with resolution map rewrite), request shape (togetherai: prefix stripping, dimension snap to multiples of 8 with min 64, optional knob clamping/forwarding, input_image → image_base64 aliasing), and output handling for both url/b64_json branches plus the wrapped error message.

closes #2987

Mocks the together-ai SDK at the module boundary, boots a real
PuterServer for the wired MeteringService, and exercises construction
(missing-key throw), model catalog (default + verbatim list), test_mode
bypass, prompt validation, the credit gate (402 before SDK), all three
pricing branches (per-MP × ratio, per-image, per-tier with resolution
map rewrite), request shape (togetherai: prefix stripping, dimension
snap to multiples of 8 with min 64, optional knob clamping/forwarding,
input_image → image_base64 aliasing), and output handling for both
url/b64_json branches plus the wrapped error message.

closes #2987
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 41.98%
⬇️ -0.35%
7420 / 17674
🔵 Statements 41.07%
⬇️ -0.33%
7825 / 19051
🔵 Functions 45.14%
⬇️ -0.74%
1348 / 2986
🔵 Branches 31.03%
⬇️ -0.32%
4358 / 14040
File CoverageNo changed files found.
Generated in workflow #110 for commit 70892f3 by the Vitest Coverage Report Action

@Salazareo Salazareo merged commit 07a049c into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/2987 branch May 10, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tests] Add unit tests for TogetherImageProvider

1 participant