23 lines
540 B
Go
23 lines
540 B
Go
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")
|
|
}
|
|
}
|