mirror of
https://github.com/grafana/grafana.git
synced 2024-11-27 11:20:27 -06:00
26 lines
554 B
Go
26 lines
554 B
Go
|
package featuremgmt
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"github.com/stretchr/testify/require"
|
||
|
"gopkg.in/yaml.v3"
|
||
|
)
|
||
|
|
||
|
func TestReadingFeatureSettings(t *testing.T) {
|
||
|
config, err := readConfigFile("testdata/features.yaml")
|
||
|
require.NoError(t, err, "No error when reading feature configs")
|
||
|
|
||
|
assert.Equal(t, map[string]interface{}{
|
||
|
"level": "free",
|
||
|
"stack": "something",
|
||
|
"valA": "value from features.yaml",
|
||
|
}, config.Vars)
|
||
|
|
||
|
out, err := yaml.Marshal(config)
|
||
|
require.NoError(t, err)
|
||
|
fmt.Printf("%s", string(out))
|
||
|
}
|