Skip to content

Commit 1dfaae3

Browse files
committed
add docstrings
1 parent b1fc487 commit 1dfaae3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/pkg/testutils/testing.go renamed to internal/pkg/testutils/testutils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ import (
1010
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
1111
)
1212

13+
// TestParseInput centralizes the logic to test a combination of inputs (arguments, flags) for a cobra command
1314
func TestParseInput[T any](t *testing.T, cmdFactory func(*params.CmdParams) *cobra.Command, parseInputFunc func(*print.Printer, *cobra.Command, []string) (T, error), expectedModel T, argValues []string, flagValues map[string]string, isValid bool) {
1415
TestParseInputWithAdditionalFlags(t, cmdFactory, parseInputFunc, expectedModel, argValues, flagValues, map[string][]string{}, isValid)
1516
}
1617

18+
// TestParseInputWithAdditionalFlags centralizes the logic to test a combination of inputs (arguments, flags) for a cobra command.
19+
// It allows to pass multiple instances of a single flag to the cobra command using the `additionalFlagValues` parameter.
1720
func TestParseInputWithAdditionalFlags[T any](t *testing.T, cmdFactory func(*params.CmdParams) *cobra.Command, parseInputFunc func(*print.Printer, *cobra.Command, []string) (T, error), expectedModel T, argValues []string, flagValues map[string]string, additionalFlagValues map[string][]string, isValid bool) {
1821
p := print.NewPrinter()
1922
cmd := cmdFactory(&params.CmdParams{Printer: p})

0 commit comments

Comments
 (0)