-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for invoking non-existant APIs
- Loading branch information
Showing
2 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<?php namespace com\openai\unittest; | ||
|
||
use com\openai\rest\OpenAIEndpoint; | ||
use test\{Assert, Test}; | ||
use webservices\rest\TestEndpoint; | ||
use test\{Assert, Expect, Test}; | ||
use util\log\{LogCategory, BufferedAppender}; | ||
use webservices\rest\{TestEndpoint, UnexpectedStatus}; | ||
|
||
class OpenAIEndpointTest { | ||
const URI= 'https://[email protected]/v1'; | ||
|
@@ -50,4 +51,10 @@ public function stream() { | |
$endpoint->api('/chat/completions')->stream(['stream' => true])->result() | ||
); | ||
} | ||
|
||
#[Test, Expect(UnexpectedStatus::class)] | ||
public function invoke_non_existant_api() { | ||
$endpoint= new OpenAIEndpoint($this->testingEndpoint()); | ||
$endpoint->api('/non-exisant')->invoke([]); | ||
} | ||
} |