diff --git a/tests/package/wp7-02-controlled-executor.test.mjs b/tests/package/wp7-02-controlled-executor.test.mjs index eb63f28..6a2a718 100644 --- a/tests/package/wp7-02-controlled-executor.test.mjs +++ b/tests/package/wp7-02-controlled-executor.test.mjs @@ -96,6 +96,14 @@ test("TDD-WP7-EXT-001 builds protocol-specific requests without auth in argument size: "1008x1792", }); assert.equal("authorization" in openai.headers, false); + + const openaiEdit = buildProviderRequest({ modelConfig: models[2], prompt: "controlled fixture prompt", ratio: "1:1", reference }); + assert.equal(openaiEdit.url, "https://oneapi.intelligrow.cn/v1/images/edits"); + assert.equal(openaiEdit.body instanceof FormData, true); + assert.equal(openaiEdit.body.get("model"), "gpt-image-2"); + assert.equal(openaiEdit.body.get("size"), "1088x1088"); + assert.equal(openaiEdit.body.get("image[]") instanceof Blob, true); + assert.equal("content-type" in openaiEdit.headers, false); }); test("TDD-WP7-EXT-001 retains only response metadata and hashes", () => { diff --git a/tests/package/wp7-02-external-contract.test.mjs b/tests/package/wp7-02-external-contract.test.mjs index e0dbdf8..993a068 100644 --- a/tests/package/wp7-02-external-contract.test.mjs +++ b/tests/package/wp7-02-external-contract.test.mjs @@ -98,7 +98,7 @@ test("TDD-WP7-EXT-001 remains externally blocked without confirmation, config an test("TDD-WP7-EXT-001 fixes independent OneAPI routes without embedding credentials", () => { const manifest = JSON.parse(readFileSync("config/wp7-02-oneapi-test.json", "utf8")); - assert.equal(manifest.config_set_version, 2); + assert.equal(manifest.config_set_version, 3); assert.equal(manifest.gateway_account_ref, "oneapi-intelligrow-test"); assert.deepEqual(manifest.models.map((entry) => entry.model_id), WP7_02_MODEL_IDS); assert.deepEqual(manifest.models.map((entry) => entry.route_profile.protocol_version), [ @@ -106,8 +106,9 @@ test("TDD-WP7-EXT-001 fixes independent OneAPI routes without embedding credenti "gemini-native-v1", "openai-images-v1", ]); - assert.deepEqual(manifest.models.map((entry) => entry.config_version), [2, 2, 1]); + assert.deepEqual(manifest.models.map((entry) => entry.config_version), [2, 2, 2]); assert.equal(manifest.models.slice(0, 2).every((entry) => /\/v1\/models\/.+:generateContent$/.test(entry.route_profile.endpoint)), true); + assert.equal(manifest.models[2].route_profile.reference_endpoint, "https://oneapi.intelligrow.cn/v1/images/edits"); assert.equal(manifest.models.every((entry) => entry.route_profile.endpoint.startsWith("https://oneapi.intelligrow.cn/")), true); assert.doesNotMatch(JSON.stringify(manifest), /api[_-]?key|authorization|bearer|sk-[A-Za-z0-9]/i); });