Skip to content

Commit 857fd45

Browse files
committed
Update topenAIImages.m
Add openAIImages positive test using OPENAI_KEY to increase code coverage
1 parent 3975f2c commit 857fd45

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/topenAIImages.m

+12
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,18 @@ function invalidInputsVariation(testCase, InvalidVariationInput)
129129
mdl = openAIImages(ApiKey="this-is-not-a-real-key");
130130
testCase.verifyError(@()createVariation(mdl,InvalidVariationInput.Input{:}), InvalidVariationInput.Error);
131131
end
132+
133+
function testThatImageIsReturned(testCase)
134+
mdl = openAIImages(ApiKey=getenv("OPENAI_KEY"));
135+
136+
[images, response] = generate(mdl, ...
137+
"Create a 3D avatar of a whimsical sushi on the beach. " + ...
138+
"He is decorated with various sushi elements and is " + ...
139+
"playfully interacting with the beach environment.");
140+
141+
testCase.verifySize(images{:}, [1024, 1024, 3]);
142+
testCase.verifyEqual(response.StatusLine.ReasonPhrase, "OK");
143+
end
132144
end
133145
end
134146

0 commit comments

Comments
 (0)