Skip to content

tests: add unit tests for XAIImageProvider#3045

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

tests: add unit tests for XAIImageProvider#3045
Salazareo merged 1 commit into
mainfrom
DS/2988

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Mocks the OpenAI SDK at the module boundary, boots a real PuterServer for the wired MeteringService, and exercises construction (xAI base URL, missing-key throw), model catalog (default + verbatim list), test_mode bypass, prompt validation, the credit gate (402 before SDK), model resolution (alias and unknown-id fallback), and the success path covering URL/b64_json branches plus per-image metering with the expected microcent override.

closes #2988

Mocks the OpenAI SDK at the module boundary, boots a real PuterServer
for the wired MeteringService, and exercises construction (xAI base
URL, missing-key throw), model catalog (default + verbatim list),
test_mode bypass, prompt validation, the credit gate (402 before SDK),
model resolution (alias and unknown-id fallback), and the success
path covering URL/b64_json branches plus per-image metering with the
expected microcent override.

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

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 41.63%
⬇️ -0.70%
7358 / 17674
🔵 Statements 40.72%
⬇️ -0.68%
7758 / 19051
🔵 Functions 45.01%
⬇️ -0.87%
1344 / 2986
🔵 Branches 30.64%
⬇️ -0.71%
4303 / 14040
File CoverageNo changed files found.
Generated in workflow #106 for commit b70650e by the Vitest Coverage Report Action

@Salazareo Salazareo merged commit 9a4a0ac into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/2988 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 XAIImageProvider

1 participant