Close #74: Add maintenance window

This commit is contained in:
TwinProduction
2021-09-22 00:04:51 -04:00
parent dc173b29bc
commit fa4736c672
6 changed files with 399 additions and 8 deletions

View File

@ -43,6 +43,11 @@ func TestParseAndValidateConfigBytes(t *testing.T) {
config, err := parseAndValidateConfigBytes([]byte(fmt.Sprintf(`
storage:
file: %s
maintenance:
enabled: true
start: 00:00
duration: 4h
every: [Monday, Thursday]
ui:
title: Test
services:
@ -79,6 +84,9 @@ services:
if config.UI == nil || config.UI.Title != "Test" {
t.Error("Expected Config.UI.Title to be Test")
}
if mc := config.Maintenance; mc == nil || mc.Start != "00:00" || !mc.IsEnabled() || mc.Duration != 4*time.Hour || len(mc.Every) != 2 {
t.Error("Expected Config.Maintenance to be configured properly")
}
if len(config.Services) != 3 {
t.Error("Should have returned two services")
}