Add tests (#171)

* test models listing

* remove non-needed method

* test for .streamFinished

* add more error tests

* improve stream testing

* fix typo
This commit is contained in:
sashabaranov
2023-03-16 19:10:27 +04:00
committed by GitHub
parent fd44d3665e
commit a8acb5f63b
6 changed files with 23 additions and 5 deletions

View File

@@ -93,6 +93,11 @@ func TestCreateCompletionStream(t *testing.T) {
if !errors.Is(streamErr, io.EOF) {
t.Errorf("stream.Recv() did not return EOF in the end: %v", streamErr)
}
_, streamErr = stream.Recv()
if !errors.Is(streamErr, io.EOF) {
t.Errorf("stream.Recv() did not return EOF when the stream is finished: %v", streamErr)
}
}
// A "tokenRoundTripper" is a struct that implements the RoundTripper