MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestFunctionalOptAtTheEndWins

Function TestFunctionalOptAtTheEndWins

pkg/util/modules/modules_test.go:88–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

86}
87
88func TestFunctionalOptAtTheEndWins(t *testing.T) {
89 userVisibleMod := func(option *module) {
90 option.userVisible = true
91 }
92 sut := NewManager(log.NewNopLogger())
93 sut.RegisterModule("mod1", mockInitFunc, UserInvisibleModule, userVisibleMod, UserInvisibleModule)
94
95 m := sut.modules["mod1"]
96
97 assert.NotNil(t, mockInitFunc, m.initFn, "initFn not assigned")
98 assert.False(t, m.userVisible, "module should be internal")
99}
100
101func TestGetAllUserVisibleModulesNames(t *testing.T) {
102 sut := NewManager(log.NewNopLogger())

Callers

nothing calls this directly

Calls 2

RegisterModuleMethod · 0.95
NewManagerFunction · 0.70

Tested by

no test coverage detected