Skip to content

Commit 6f9e690

Browse files
author
QTom
committed
test(sora): 补充测试 stub 中缺失的 AddGroupToAllowedGroups 方法
feat/admin-apikey-group-update 分支给 UserRepository 接口新增了 AddGroupToAllowedGroups 方法,需要在测试 stub 中补充实现以通过编译。 - sora_client_handler_test.go: stubUserRepoForHandler - sora_generation_service_test.go: stubUserRepoForQuota
1 parent 9a91815 commit 6f9e690

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

backend/internal/handler/sora_client_handler_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,9 @@ func (r *stubUserRepoForHandler) RemoveGroupFromAllowedGroups(context.Context, i
945945
func (r *stubUserRepoForHandler) UpdateTotpSecret(context.Context, int64, *string) error { return nil }
946946
func (r *stubUserRepoForHandler) EnableTotp(context.Context, int64) error { return nil }
947947
func (r *stubUserRepoForHandler) DisableTotp(context.Context, int64) error { return nil }
948+
func (r *stubUserRepoForHandler) AddGroupToAllowedGroups(context.Context, int64, int64) error {
949+
return nil
950+
}
948951

949952
// ==================== NewSoraClientHandler ====================
950953

backend/internal/service/sora_generation_service_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ func (r *stubUserRepoForQuota) RemoveGroupFromAllowedGroups(context.Context, int
165165
func (r *stubUserRepoForQuota) UpdateTotpSecret(context.Context, int64, *string) error { return nil }
166166
func (r *stubUserRepoForQuota) EnableTotp(context.Context, int64) error { return nil }
167167
func (r *stubUserRepoForQuota) DisableTotp(context.Context, int64) error { return nil }
168+
func (r *stubUserRepoForQuota) AddGroupToAllowedGroups(context.Context, int64, int64) error {
169+
return nil
170+
}
168171

169172
// ==================== 辅助函数:构造带 CDN 缓存的 SoraS3Storage ====================
170173

0 commit comments

Comments
 (0)