MCPcopy
hub / github.com/crowdsecurity/crowdsec / TestGetEnabledFeatures

Function TestGetEnabledFeatures

pkg/fflag/features_test.go:372–391  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

370}
371
372func TestGetEnabledFeatures(t *testing.T) {
373 fr := setUp(t)
374
375 feat1, err := fr.GetFeature("new_standard")
376 require.NoError(t, err)
377 err = feat1.Set(true)
378 require.Error(t, err, "the flag is deprecated")
379
380 feat2, err := fr.GetFeature("experimental1")
381 require.NoError(t, err)
382 err = feat2.Set(true)
383 require.NoError(t, err)
384
385 expected := []string{
386 "experimental1",
387 "new_standard",
388 }
389
390 require.Equal(t, expected, fr.GetEnabledFeatures())
391}

Callers

nothing calls this directly

Calls 5

setUpFunction · 0.85
GetFeatureMethod · 0.80
GetEnabledFeaturesMethod · 0.80
ErrorMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…