mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
33a1c32cf8
Reorganize internal packages into platform/infra/shared layers and update imports, docs, and seed-count tests to match current system configs.
26 lines
640 B
Go
26 lines
640 B
Go
package db
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/redis/go-redis/v9/maintnotifications"
|
|
)
|
|
|
|
func TestRedisMaintNotificationsConfig(t *testing.T) {
|
|
for _, test := range []struct {
|
|
name string
|
|
enabled bool
|
|
want maintnotifications.Mode
|
|
}{
|
|
{name: "disabled by default", enabled: false, want: maintnotifications.ModeDisabled},
|
|
{name: "auto when enabled", enabled: true, want: maintnotifications.ModeAuto},
|
|
} {
|
|
t.Run(test.name, func(t *testing.T) {
|
|
cfg := redisMaintNotificationsConfig(test.enabled)
|
|
if cfg.Mode != test.want {
|
|
t.Fatalf("maintenance notifications mode = %v, want %v", cfg.Mode, test.want)
|
|
}
|
|
})
|
|
}
|
|
}
|