Micro-service for file storage and processing written in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
527 B

package settings
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSettingsLoading(t *testing.T) {
const file string = `{
"endpoint": "0.0.0.0:8000",
"token": "foobar",
"fileSystem": {
"type": 0,
"basePath": "assets"
}
}`
t.Run("Settings parsing is successful", func(t *testing.T) {
settings := ParseSettings([]byte(file))
assert.Equal(t, "0.0.0.0:8000", settings.Endpoint)
assert.Equal(t, "foobar", settings.Token)
assert.Equal(t, "assets", settings.FileSystem.BasePath)
})
}