完善 API Key 能力范围可视化和维护
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user