genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/models/config_test.go

27 lines
567 B
Go
Raw Normal View History

2017-05-03 07:30:18 +02:00
// Package with the mostly static content (models) of this microservice
2017-03-25 16:09:17 +01:00
package models
import (
"testing"
"github.com/stretchr/testify/assert"
)
2017-05-03 07:30:18 +02:00
// Function to test the configuration of the microservice
2017-03-25 16:09:17 +01:00
func TestReadConfig(t *testing.T) {
assert := assert.New(t)
config := ReadConfigFile("../config_example.conf")
assert.NotNil(config)
2017-03-30 15:32:22 +02:00
assert.Equal(":8080", config.WebserverBind)
2017-03-26 19:33:47 +02:00
assert.Panics(func() {
ReadConfigFile("../config_example.co")
}, "wrong file")
assert.Panics(func() {
ReadConfigFile("testdata/config_panic.conf")
}, "wrong toml")
2017-03-25 16:09:17 +01:00
}