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
537 B

  1. package settings
  2. import (
  3. "testing"
  4. "github.com/stretchr/testify/assert"
  5. )
  6. func TestSettingsLoading(t *testing.T) {
  7. const file string = `{
  8. "endpoint": "0.0.0.0:8000",
  9. "token": "foobar",
  10. "storageProvider": {
  11. "type": 0,
  12. "basePath": "assets"
  13. }
  14. }`
  15. t.Run("Settings parsing is successful", func(t *testing.T) {
  16. settings := parseSettings([]byte(file))
  17. assert.Equal(t, "0.0.0.0:8000", settings.Endpoint)
  18. assert.Equal(t, "foobar", settings.Token)
  19. assert.Equal(t, "assets", settings.StorageProvider.BasePath)
  20. })
  21. }