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

Function TestCommand_Run_failInvalidPath

internal/util/update/update_test.go:619–634  ·  view source on GitHub ↗

TestCommand_Run_failInvalidPath verifies Run fails if the path is invalid

(t *testing.T)

Source from the content-addressed store, hash-verified

617
618// TestCommand_Run_failInvalidPath verifies Run fails if the path is invalid
619func TestCommand_Run_failInvalidPath(t *testing.T) {
620 for i := range updateStrategies {
621 strategy := updateStrategies[i]
622 t.Run(string(strategy), func(t *testing.T) {
623 path := filepath.Join("fake", "path")
624 err := Command{
625 Path: path,
626 FullPackagePath: toAbsPath(t, path),
627 Strategy: strategy,
628 }.Run()
629 if assert.Error(t, err) {
630 assert.Contains(t, err.Error(), "no such file or directory")
631 }
632 })
633 }
634}
635
636// TestCommand_Run_failInvalidRef verifies Run fails if the ref is invalid
637func TestCommand_Run_failInvalidRef(t *testing.T) {

Callers

nothing calls this directly

Calls 3

toAbsPathFunction · 0.85
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected