Skip to content

tests: add unit tests for ReplicateImageGenerationProvider#3048

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

tests: add unit tests for ReplicateImageGenerationProvider#3048
Salazareo merged 1 commit into
mainfrom
DS/2986

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Mocks the replicate SDK and util/secureHttp at the module boundary (real network egress points), boots a real PuterServer for the wired MeteringService. Covers construction (missing-key throw), model catalog (flux-schnell default + verbatim list), test_mode bypass, prompt validation, the credit gate (402 before SDK), per-image billing (replicateId routing, aspect_ratio gcd formatting, single-output metering, string vs array output extraction, missing URL → 400), megapixel billing (run + output_mp batched components), the param-aliasing/transform/filter machinery (drops disallowed keys, renames steps→num_inference_steps + response_format→output_format, injects go_fast=true default for flux-2-dev, appends ' MP' suffix to flux-2-pro resolution), and the costs_go_fast pricing branch.

closes #2986

Mocks the replicate SDK and util/secureHttp at the module boundary
(real network egress points), boots a real PuterServer for the wired
MeteringService. Covers construction (missing-key throw), model
catalog (flux-schnell default + verbatim list), test_mode bypass,
prompt validation, the credit gate (402 before SDK), per-image
billing (replicateId routing, aspect_ratio gcd formatting,
single-output metering, string vs array output extraction, missing
URL → 400), megapixel billing (run + output_mp batched components),
the param-aliasing/transform/filter machinery (drops disallowed
keys, renames steps→num_inference_steps + response_format→output_format,
injects go_fast=true default for flux-2-dev, appends ' MP' suffix to
flux-2-pro resolution), and the costs_go_fast pricing branch.

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

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.24%
⬇️ -0.09%
7466 / 17674
🔵 Statements 41.34%
⬇️ -0.06%
7876 / 19051
🔵 Functions 45.41%
⬇️ -0.47%
1356 / 2986
🔵 Branches 31.38%
⬆️ +0.03%
4406 / 14040
File CoverageNo changed files found.
Generated in workflow #109 for commit 44c7927 by the Vitest Coverage Report Action

@Salazareo Salazareo merged commit 0990fc2 into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/2986 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 ReplicateImageGenerationProvider

1 participant