MCPcopy
hub / github.com/kubernetes/kops / TestSetenv

Function TestSetenv

pkg/featureflag/featureflag_test.go:45–60  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

43}
44
45func TestSetenv(t *testing.T) {
46 f := new("UnitTest2", Bool(true))
47 if !f.Enabled() {
48 t.Fatalf("Flag did not default true")
49 }
50
51 t.Setenv("KOPS_FEATURE_FLAGS", "-UnitTest2")
52 if !f.Enabled() {
53 t.Fatalf("Flag was reparsed immediately after os.Setenv")
54 }
55
56 ParseFlags("-UnitTest2")
57 if f.Enabled() {
58 t.Fatalf("Flag was not updated by ParseFlags")
59 }
60}
61
62func TestGetPositive(t *testing.T) {
63 // Find a random existing feature

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
ParseFlagsFunction · 0.85
EnabledMethod · 0.80
BoolFunction · 0.70

Tested by

no test coverage detected