swaps the corso go module from github.com/ alcionai/corso to github.com/alcionai/corso/src to align with the location of the go.mod and go.sum files inside the repo. All other changes in the repository update the package imports to the new module path.
39 lines
731 B
Go
39 lines
731 B
Go
package utils_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/suite"
|
|
|
|
"github.com/alcionai/corso/src/cli/utils"
|
|
)
|
|
|
|
type CliUtilsSuite struct {
|
|
suite.Suite
|
|
}
|
|
|
|
func TestCliUtilsSuite(t *testing.T) {
|
|
suite.Run(t, new(CliUtilsSuite))
|
|
}
|
|
|
|
func (suite *CliUtilsSuite) TestRequireProps() {
|
|
table := []struct {
|
|
name string
|
|
props map[string]string
|
|
errCheck assert.ErrorAssertionFunc
|
|
}{
|
|
{
|
|
props: map[string]string{"exists": "I have seen the fnords!"},
|
|
errCheck: assert.NoError,
|
|
},
|
|
{
|
|
props: map[string]string{"not-exists": ""},
|
|
errCheck: assert.Error,
|
|
},
|
|
}
|
|
for _, test := range table {
|
|
test.errCheck(suite.T(), utils.RequireProps(test.props))
|
|
}
|
|
}
|