Add more tests (#241)
* add form builder tests * lint * add client tests * lint * add non-existent file test
This commit is contained in:
22
client_test.go
Normal file
22
client_test.go
Normal 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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user