yanic/models/config_test.go

24 lines
576 B
Go
Raw Normal View History

2016-03-20 19:54:43 +01:00
package models
import (
"testing"
"time"
2016-03-20 19:54:43 +01:00
"github.com/stretchr/testify/assert"
)
func TestReadConfig(t *testing.T) {
assert := assert.New(t)
config := ReadConfigFile("../config_example.toml")
2016-03-20 19:54:43 +01:00
assert.NotNil(config)
assert.True(config.Respondd.Enable)
assert.Equal("eth0", config.Respondd.Interface)
assert.Equal(time.Minute, config.Respondd.CollectInterval.Duration)
assert.Equal(2, config.Nodes.NodesVersion)
assert.Equal("/var/www/html/meshviewer/data/nodes_all.json", config.Nodes.NodesPath)
assert.Equal(time.Hour*24*7, config.Nodes.PruneAfter.Duration)
2016-03-20 19:54:43 +01:00
}