MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / AssertSuccess

Function AssertSuccess

test/testutil/testutil.go:18–29  ·  view source on GitHub ↗

This file contains utilities to help with unit and integration testing AssertSuccess checks that err is nil and returns true. If it's not, it will print all the args, then write the Error string, fail the test, and return false

(t *testing.T, err error, args ...any)

Source from the content-addressed store, hash-verified

16// AssertSuccess checks that err is nil and returns true.
17// If it's not, it will print all the args, then write the Error string, fail the test, and return false
18func AssertSuccess(t *testing.T, err error, args ...any) bool {
19 if err != nil {
20 for _, arg := range args {
21 t.Log(arg)
22 }
23 t.Error(err.Error())
24 debug.PrintStack()
25
26 return false
27 }
28 return true
29}
30
31func RequireSuccess(t *testing.T, err error, args ...any) bool {
32 if err != nil {

Callers 7

TestReleaseCreateBasicsFunction · 0.92
TestReleaseListAndDeleteFunction · 0.92
CreateCommonProjectFunction · 0.92
TestAccountListFunction · 0.92

Calls 1

ErrorMethod · 0.45

Tested by 6

TestReleaseCreateBasicsFunction · 0.74
TestReleaseListAndDeleteFunction · 0.74
TestAccountListFunction · 0.74