MCPcopy Create free account
hub / github.com/conforma/cli / TestBundleCommandHelp

Function TestBundleCommandHelp

cmd/track/track_bundle_test.go:274–298  ·  view source on GitHub ↗

TestBundleCommandHelp tests that the command help reflects the new expires_on behavior

(t *testing.T)

Source from the content-addressed store, hash-verified

272
273// TestBundleCommandHelp tests that the command help reflects the new expires_on behavior
274func TestBundleCommandHelp(t *testing.T) {
275 trackBundleCmd := trackBundleCmd(nil, nil, nil)
276
277 // Verify the long description mentions expires_on
278 assert.Contains(t, trackBundleCmd.Long, "expires_on",
279 "Command help should mention expires_on")
280
281 // Verify it explains the new behavior
282 assert.Contains(t, trackBundleCmd.Long, "expiration date is added",
283 "Command help should explain that expiration dates are added")
284
285 // Verify pruning explanation is updated
286 assert.Contains(t, trackBundleCmd.Long, "expired entries are removed",
287 "Command help should explain pruning removes expired entries")
288
289 // Verify the in-effect-days flag is documented
290 foundFlag := false
291 trackBundleCmd.Flags().VisitAll(func(flag *pflag.Flag) {
292 if flag.Name == "in-effect-days" {
293 foundFlag = true
294 assert.Equal(t, "60", flag.DefValue, "Default value should be 60")
295 }
296 })
297 assert.True(t, foundFlag, "in-effect-days flag should exist")
298}
299
300func TestPreRunE(t *testing.T) {
301 cases := []struct {

Callers

nothing calls this directly

Calls 1

trackBundleCmdFunction · 0.85

Tested by

no test coverage detected