Modify the test module, add the file upload test, and add the image edit api (#63)
* Modify the test module, add the file upload test, and add the image editing api * fix golangci-lint * fix golangci-lint * Static file deletion, file directory name modification * fix * test-server-related logic encapsulated in a single tidy struct --------- Co-authored-by: julian_huang <julian.huang@yuansuan.com>
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package gogpt_test
|
||||
|
||||
import (
|
||||
. "github.com/sashabaranov/go-gpt3"
|
||||
"github.com/sashabaranov/go-gpt3/internal/test"
|
||||
|
||||
"context"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
. "github.com/sashabaranov/go-gpt3"
|
||||
)
|
||||
|
||||
func TestCreateCompletionStream(t *testing.T) {
|
||||
@@ -36,7 +37,7 @@ func TestCreateCompletionStream(t *testing.T) {
|
||||
defer server.Close()
|
||||
|
||||
// Client portion of the test
|
||||
client := NewClient(testAPIToken)
|
||||
client := NewClient(test.GetTestToken())
|
||||
ctx := context.Background()
|
||||
client.BaseURL = server.URL + "/v1"
|
||||
|
||||
@@ -48,7 +49,7 @@ func TestCreateCompletionStream(t *testing.T) {
|
||||
}
|
||||
|
||||
client.HTTPClient.Transport = &tokenRoundTripper{
|
||||
testAPIToken,
|
||||
test.GetTestToken(),
|
||||
http.DefaultTransport,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user