MCPcopy
hub / github.com/helm/helm / TestLogHolder_InterfaceCompliance

Function TestLogHolder_InterfaceCompliance

internal/logging/logging_test.go:100–117  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

98}
99
100func TestLogHolder_InterfaceCompliance(t *testing.T) {
101 t.Run("implements LoggerSetterGetter interface", func(_ *testing.T) {
102 var _ LoggerSetterGetter = &LogHolder{}
103 })
104
105 t.Run("interface methods work correctly", func(t *testing.T) {
106 var holder LoggerSetterGetter = &LogHolder{}
107
108 buf := &bytes.Buffer{}
109 handler := slog.NewTextHandler(buf, &slog.HandlerOptions{Level: slog.LevelDebug})
110
111 holder.SetLogger(handler)
112 logger := holder.Logger()
113
114 assert.NotNil(t, logger)
115 assert.Equal(t, handler, logger.Handler())
116 })
117}
118
119func TestDebugCheckHandler_Enabled(t *testing.T) {
120 t.Run("returns debugEnabled function result for debug level", func(t *testing.T) {

Callers

nothing calls this directly

Calls 3

SetLoggerMethod · 0.95
LoggerMethod · 0.95
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…