mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-05-20 08:04:52 +00:00
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1m26s
Post / coverage (push) Failing after 39m1s
Post / images (amd64) (push) Failing after 8m21s
Post / images (arm64) (push) Failing after 7m47s
Post / image manifest (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Successful in 47s
Signed-off-by: Jian Qiu <jqiu@redhat.com>
27 lines
577 B
Go
27 lines
577 B
Go
package webhook
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/spf13/pflag"
|
|
)
|
|
|
|
func TestOptions_AddFlags(t *testing.T) {
|
|
opts := NewOptions()
|
|
flags := pflag.NewFlagSet("test", pflag.ContinueOnError)
|
|
|
|
// Verify initial state
|
|
expectedDefault := opts.ManifestLimit
|
|
opts.AddFlags(flags)
|
|
// Verify flag was registered
|
|
flag := flags.Lookup("manifestLimit")
|
|
if flag == nil {
|
|
t.Error("manifestLimit flag not registered")
|
|
}
|
|
|
|
// Verify default value is preserved
|
|
if opts.ManifestLimit != expectedDefault {
|
|
t.Errorf("expected %d, but got %d", expectedDefault, opts.ManifestLimit)
|
|
}
|
|
}
|