-
Notifications
You must be signed in to change notification settings - Fork 2
/
config_test.go
46 lines (34 loc) · 782 Bytes
/
config_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main_test
import (
"testing"
main "github.com/hguandl/dr-feeder/v2"
"github.com/hguandl/dr-feeder/v2/notifier"
"github.com/hguandl/dr-feeder/v2/watcher"
)
var config main.YamlConfig
func TestLoadConfig(t *testing.T) {
var err error = nil
config, err = main.LoadConfig("config.yaml")
if err != nil {
t.Error(err)
}
t.Logf("Config file version %v.", config.Version)
}
func TestParseNotifiers(t *testing.T) {
notifiers, err := notifier.ParseNotifiers(config.Notifiers)
if err != nil {
t.Error(err)
}
for _, n := range notifiers {
t.Logf("%v", n)
}
}
func TestParseWatchers(t *testing.T) {
watchers, err := watcher.ParseWatchers(config.Watchers, "", false)
if err != nil {
t.Error(err)
}
for _, n := range watchers {
t.Logf("%v", n)
}
}