d775b2159a
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
24 lines
508 B
Go
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)
|
|
}
|