2026-05-12 01:55:29 +08:00
|
|
|
package app
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"reflect"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestAdminUserInvalidateQuotaSummaryCache(t *testing.T) {
|
|
|
|
|
cache := &recordingCache{}
|
|
|
|
|
svc := NewAdminUserService(nil, nil, "").WithCache(cache)
|
|
|
|
|
|
|
|
|
|
svc.invalidateQuotaSummaryCache(context.Background(), 42)
|
|
|
|
|
|
2026-07-24 09:04:06 +08:00
|
|
|
if want := []string{"workspace:quota_summary:42", "brand:library_summary:42"}; !reflect.DeepEqual(cache.deletedKeys, want) {
|
2026-05-12 01:55:29 +08:00
|
|
|
t.Fatalf("deleted keys = %v, want %v", cache.deletedKeys, want)
|
|
|
|
|
}
|
|
|
|
|
}
|