MCPcopy
hub / github.com/kopia/kopia / RunAndExpectSuccess

Method RunAndExpectSuccess

tests/testenv/cli_test_env.go:116–123  ·  view source on GitHub ↗

RunAndExpectSuccess runs the given command, expects it to succeed and returns its output lines.

(tb testing.TB, args ...string)

Source from the content-addressed store, hash-verified

114
115// RunAndExpectSuccess runs the given command, expects it to succeed and returns its output lines.
116func (e *CLITest) RunAndExpectSuccess(tb testing.TB, args ...string) []string {
117 tb.Helper()
118
119 stdout, _, err := e.Run(tb, false, args...)
120 require.NoError(tb, err, "'kopia %v' failed", strings.Join(args, " "))
121
122 return stdout
123}
124
125// TweakFile writes a xor-ed byte at a random point in a file. Used to simulate file corruption.
126func (e *CLITest) TweakFile(tb testing.TB, dirn, fglob string) {

Calls 2

RunMethod · 0.95
HelperMethod · 0.80