diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2021-07-04 17:20:50 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2021-07-04 17:20:50 +0100 |
| commit | d95e8ce75cc193181fd8cf9272269fbfff911f66 (patch) | |
| tree | f25e86b4768050d39b932bfb9e42970cfc5936e4 /config_test.go | |
| parent | 03f9f907ed21a9c56b229668b28571969d988a8c (diff) | |
Simplify project structure
Diffstat (limited to 'config_test.go')
| -rw-r--r-- | config_test.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/config_test.go b/config_test.go new file mode 100644 index 0000000..a303719 --- /dev/null +++ b/config_test.go @@ -0,0 +1,36 @@ +package main + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +const cfg string = ` +message: + from: foo@example.com + to: bar@example.com + subject: New SMS From {{.From}} For {{.To}} + template: | + From: {{.From}} + To: {{.To}} + Date: {{.DateReceived.UTC}} + + {{.Message}} + +smtp: + hostname: example.com:465 + username: bar + password: some password + +twilio: + address: /run/fwdsms/socket + authToken: some token + endpoint: / +` + +func TestConfig(t *testing.T) { + _, err := loadConfig(strings.NewReader(cfg)) + assert.NoError(t, err) +} |
