Files
knowledge-governance/internal/librarystack/stack_test.go
T
姚章浩 d0c6d57283
build / build (push) Successful in 1m23s
fix(storage): 按提供方选择整库对象寻址方式
2026-10-31 06:22:20 +08:00

22 lines
897 B
Go

package librarystack
import (
"knowledge-governance/internal/appconfig"
"testing"
)
func TestObjectAddressingMatchesProvider(t *testing.T) {
for _, provider := range []string{"oss", "s3", "minio"} {
t.Run(provider, func(t *testing.T) {
config := appconfig.Config{LibraryProductionDatabaseURL: "configured", LibraryProductionElasticURL: "configured", LibraryProductionTenantID: 1, LibraryProductionInternalKB: "kb-target", LibraryProductionS3Endpoint: "https://storage.example", LibraryProductionS3Bucket: "test-bucket", LibraryProductionS3AccessKey: "fixture", LibraryProductionS3SecretKey: "fixture", LibraryProductionS3Provider: provider}
scope, err := scopeConfigOf(config, "internal")
if err != nil {
t.Fatal(err)
}
if scope.s3.ForcePathStyle != (provider == "minio") {
t.Fatalf("provider %s: ForcePathStyle=%v", provider, scope.s3.ForcePathStyle)
}
})
}
}