2019-04-25 04:52:08 +07:00
|
|
|
package configuration
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestShouldParseConfigFile(t *testing.T) {
|
2019-10-29 05:47:58 +07:00
|
|
|
config, errors := Read("../test/resources/config.yml")
|
2019-04-25 04:52:08 +07:00
|
|
|
|
|
|
|
assert.Len(t, errors, 0)
|
|
|
|
|
|
|
|
assert.Equal(t, 9091, config.Port)
|
|
|
|
assert.Equal(t, "debug", config.LogsLevel)
|
|
|
|
assert.Equal(t, "https://home.example.com:8080/", config.DefaultRedirectionURL)
|
|
|
|
assert.Equal(t, "authelia.com", config.TOTP.Issuer)
|
|
|
|
|
|
|
|
assert.Equal(t, "api-123456789.example.com", config.DuoAPI.Hostname)
|
|
|
|
assert.Equal(t, "ABCDEF", config.DuoAPI.IntegrationKey)
|
|
|
|
assert.Equal(t, "1234567890abcdefghifjkl", config.DuoAPI.SecretKey)
|
|
|
|
}
|