Skip to content

Commit

Permalink
unit tests for messages api and update one error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
dleviminzi committed Apr 25, 2024
1 parent da79bff commit 4782ed6
Show file tree
Hide file tree
Showing 4 changed files with 701 additions and 7 deletions.
12 changes: 6 additions & 6 deletions complete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestComplete(t *testing.T) {
client, err := NewClient(WithApiKey("blah"))
require.NoError(t, err)

client.HttpClient = mockHTTPClient
client.httpClient = mockHTTPClient

payload := CompletionPayload{
MaxTokensToSample: 10,
Expand Down Expand Up @@ -64,7 +64,7 @@ func TestComplete_HttpClientError(t *testing.T) {
client, err := NewClient(WithApiKey("blah"))
require.NoError(t, err)

client.HttpClient = mockHTTPClient
client.httpClient = mockHTTPClient

payload := CompletionPayload{}

Expand All @@ -87,7 +87,7 @@ func TestComplete_Non200StatusCode(t *testing.T) {
client, err := NewClient(WithApiKey("blah"))
require.NoError(t, err)

client.HttpClient = mockHTTPClient
client.httpClient = mockHTTPClient

payload := CompletionPayload{}

Expand All @@ -109,7 +109,7 @@ func TestComplete_UnmarshalError(t *testing.T) {
client, err := NewClient(WithApiKey("blah"))
require.NoError(t, err)

client.HttpClient = mockHTTPClient
client.httpClient = mockHTTPClient

payload := CompletionPayload{}

Expand All @@ -135,7 +135,7 @@ func TestCompleteStream(t *testing.T) {
client, err := NewClient(WithApiKey("blah"))
require.NoError(t, err)

client.HttpClient = mockHTTPClient
client.httpClient = mockHTTPClient

payload := CompletionPayload{}

Expand All @@ -159,7 +159,7 @@ func TestCompleteStream_HttpClientError(t *testing.T) {
client, err := NewClient(WithApiKey("blah"))
require.NoError(t, err)

client.HttpClient = mockHTTPClient
client.httpClient = mockHTTPClient

payload := CompletionPayload{}

Expand Down
Loading

0 comments on commit 4782ed6

Please sign in to comment.