airshipctl/pkg/util/configreader_test.go
Ian Howell d775b2159a This updates the current unit tests for testify
This commit removes any assertion from Go's "testing" package,
preferring instead to use an assertion from the testify package. All
tests now have uniformity.

This also decrease the number of iterations in the password generation
test, decreasing test runtime tenfold

Change-Id: I8799110e93dfa19bebe9050528e865b4c991c3df
2019-11-07 12:15:06 -06:00

24 lines
508 B
Go

package util_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"opendev.org/airship/airshipctl/pkg/util"
)
func TestReadYAMLFile(t *testing.T) {
assert := assert.New(t)
require := require.New(t)
var actual map[string]interface{}
err := util.ReadYAMLFile("testdata/test.yaml", &actual)
require.NoError(err, "Error while reading YAML")
actualString := actual["testString"]
expectedString := "test"
assert.Equal(expectedString, actualString)
}