15 lines
358 B
Go
15 lines
358 B
Go
package store
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestNormalizeAPIKeyScopes(t *testing.T) {
|
|
got := normalizeAPIKeyScopes([]string{" Chat ", "AUDIO", "", "chat", "*", "all", " text_to_speech "})
|
|
want := []string{"chat", "audio", "all", "text_to_speech"}
|
|
if !reflect.DeepEqual(got, want) {
|
|
t.Fatalf("normalize scopes = %#v, want %#v", got, want)
|
|
}
|
|
}
|