Add more tests (#241)

* add form builder tests

* lint

* add client tests

* lint

* add non-existent file test
This commit is contained in:
sashabaranov
2023-04-09 18:36:15 +04:00
committed by GitHub
parent 334ee6dbdd
commit 9a1ecf5f4a
5 changed files with 125 additions and 27 deletions

22
client_test.go Normal file
View File

@@ -0,0 +1,22 @@
package openai //nolint:testpackage // testing private field
import (
"testing"
)
func TestClient(t *testing.T) {
const mockToken = "mock token"
client := NewClient(mockToken)
if client.config.authToken != mockToken {
t.Errorf("Client does not contain proper token")
}
const mockOrg = "mock org"
client = NewOrgClient(mockToken, mockOrg)
if client.config.authToken != mockToken {
t.Errorf("Client does not contain proper token")
}
if client.config.OrgID != mockOrg {
t.Errorf("Client does not contain proper orgID")
}
}