MCPcopy Create free account
hub / github.com/Driver-C/tryssh / TestNewCachesCommand_RequiredFlags

Function TestNewCachesCommand_RequiredFlags

cmd/create/create_test.go:235–248  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestNewCachesCommand_RequiredFlags(t *testing.T) {
236 cmd := NewCachesCommand()
237
238 requiredFlags := []string{"ip", "user", "port", "pwd"}
239 for _, name := range requiredFlags {
240 flag := cmd.Flags().Lookup(name)
241 assert.NotNil(t, flag, "flag %q should exist", name)
242 annotations := flag.Annotations
243 if annotations != nil {
244 _, hasRequired := annotations[cobra.BashCompOneRequiredFlag]
245 assert.True(t, hasRequired, "flag %q should be marked as required", name)
246 }
247 }
248}
249
250func TestNewCachesCommand_AliasFlagNotRequired(t *testing.T) {
251 cmd := NewCachesCommand()

Callers

nothing calls this directly

Calls 1

NewCachesCommandFunction · 0.70

Tested by

no test coverage detected