MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / TestRuntimeConfigOptions_AddFlags

Function TestRuntimeConfigOptions_AddFlags

pkg/controller/rtctrl/options_test.go:47–61  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestRuntimeConfigOptions_AddFlags(t *testing.T) {
48 fs := pflag.NewFlagSet("test", pflag.ContinueOnError)
49 disOpt := NewRuntimeConfigOptions()
50 disOpt.AddFlags(fs)
51 args := []string{
52 "--runtime-alive-timeout=10",
53 }
54 fs.Parse(args)
55 expected := &RuntimeConfigOptions{
56 WaitRuntimeAliveTimeout: 10,
57 }
58 if !reflect.DeepEqual(expected, disOpt) {
59 t.Errorf("Got different run options than expected.")
60 }
61}

Callers

nothing calls this directly

Calls 3

AddFlagsMethod · 0.95
NewRuntimeConfigOptionsFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected