aboutsummaryrefslogtreecommitdiff
path: root/server_config_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-01-21 01:12:11 +0700
committerShulhan <ms@kilabit.info>2026-01-21 01:12:11 +0700
commitfa4cc3a2ae6fa63bfbd8b005e4048dacc222dcc1 (patch)
treeb5566fe088dc51364101ab1db2a48ed845a4d832 /server_config_test.go
parentd0969869954c299c04ea58ab0fda1eba6a0350da (diff)
downloadlilin-fa4cc3a2ae6fa63bfbd8b005e4048dacc222dcc1.tar.xz
all: implement default down and up templates under section "[default"]
To minimize defining the same templates in notification, user can set default down and up templates under the default section.
Diffstat (limited to 'server_config_test.go')
-rw-r--r--server_config_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/server_config_test.go b/server_config_test.go
index bd17b5e..56542d6 100644
--- a/server_config_test.go
+++ b/server_config_test.go
@@ -37,6 +37,8 @@ func TestServerConfig_init(t *testing.T) {
configServiceDir: `testdata/server_config/ok/etc/lilin/service.d`,
logServiceDir: `testdata/server_config/ok/var/log/lilin/service.d`,
Address: `127.0.0.1:12121`,
+ DownTemplate: defaultDownTemplate,
+ UpTemplate: defaultUpTemplate,
Notifs: []*NotifConfig{{
Kind: `mattermost`,
RemoteURL: `http://127.0.0.1:12000`,
@@ -76,6 +78,15 @@ func TestServerConfig_init(t *testing.T) {
t.Fatal(err)
}
+ if cfg.upTmpl == nil {
+ t.Fatal(`ServerConfig: got nil on upTmpl, want not-nil`)
+ }
+ if cfg.downTmpl == nil {
+ t.Fatal(`ServerConfig: got nil on downTmpl, want not-nil`)
+ }
+ cfg.upTmpl = nil
+ cfg.downTmpl = nil
+
for x, notifCfg := range cfg.Notifs {
if notifCfg.upTmpl == nil {
t.Fatalf(`ServerConfig.Notifs #%d: upTmpl is nil`, x)