@@ -170,7 +170,26 @@ function canUseAPIVersions(testCase, APIVersions)
170170 response = testCase .verifyWarningFree(@() generate(chat ," How similar is the DNA of a cat and a tiger?" ));
171171 testCase .verifyClass(response ,' string' );
172172 testCase .verifyGreaterThan(strlength(response ),0 );
173+ end
173174
175+ function endpointNotFound(testCase )
176+ % to verify the error, we need to unset the environment variable
177+ % AZURE_OPENAI_ENDPOINT, if given. Use a fixture to restore the
178+ % value on leaving the test point
179+ import matlab .unittest .fixtures .EnvironmentVariableFixture
180+ testCase .applyFixture(EnvironmentVariableFixture(" AZURE_OPENAI_ENDPOINT" ," dummy" ));
181+ unsetenv(" AZURE_OPENAI_ENDPOINT" );
182+ testCase .verifyError(@()azureChat , " llms:endpointMustBeSpecified" );
183+ end
184+
185+ function deploymentNotFound(testCase )
186+ % to verify the error, we need to unset the environment variable
187+ % AZURE_OPENAI_DEPLOYMENT, if given. Use a fixture to restore the
188+ % value on leaving the test point
189+ import matlab .unittest .fixtures .EnvironmentVariableFixture
190+ testCase .applyFixture(EnvironmentVariableFixture(" AZURE_OPENAI_DEPLOYMENT" ," dummy" ));
191+ unsetenv(" AZURE_OPENAI_DEPLOYMENT" );
192+ testCase .verifyError(@()azureChat , " deploymentMustBeSpecified" );
174193 end
175194 end
176195end
0 commit comments