MCPcopy
hub / github.com/kptdev/kpt / TestCmd_failNotExists

Function TestCmd_failNotExists

internal/cmdinit/cmdinit_test.go:130–140  ·  view source on GitHub ↗

TestCmd_failExists verifies the command throws and error if the directory exists

(t *testing.T)

Source from the content-addressed store, hash-verified

128
129// TestCmd_failExists verifies the command throws and error if the directory exists
130func TestCmd_failNotExists(t *testing.T) {
131 d, err := ioutil.TempDir("", "kpt")
132 assert.NoError(t, err)
133
134 r := cmdinit.NewRunner("kpt")
135 r.Command.SetArgs([]string{filepath.Join(d, "my-pkg"), "--description", "my description", "--tag", "app.kpt.dev/cockroachdb"})
136 err = r.Command.Execute()
137 if assert.Error(t, err) {
138 assert.Contains(t, err.Error(), "does not exist")
139 }
140}
141
142func TestGitUtil_DefaultRef(t *testing.T) {
143 // set up git repo with both main and master branches

Callers

nothing calls this directly

Calls 2

NewRunnerFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected