MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / SetupTest

Method SetupTest

logger/formatter_pretty_test.go:26–56  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24}
25
26func (s *FormatterPrettyTestSuite) SetupTest() {
27 s.buf, _ = testutil.NewLazySuiteObj(
28 s,
29 func() (*bytes.Buffer, error) {
30 return new(bytes.Buffer), nil
31 },
32 )
33
34 s.config, _ = testutil.NewLazySuiteObj(
35 s,
36 func() (*logger.Config, error) {
37 cfg := logger.NewDefaultConfig()
38 cfg.Format = logger.FormatPretty
39 return &cfg, nil
40 },
41 )
42
43 s.handler, _ = testutil.NewLazySuiteObj(
44 s,
45 func() (*logger.Handler, error) {
46 return logger.NewHandler(s.buf(), s.config()), nil
47 },
48 )
49
50 s.logger, _ = testutil.NewLazySuiteObj(
51 s,
52 func() (*slog.Logger, error) {
53 return slog.New(s.handler()), nil
54 },
55 )
56}
57
58func (s *FormatterPrettyTestSuite) SetupSubTest() {
59 s.ResetLazyObjects()

Callers

nothing calls this directly

Calls 4

NewLazySuiteObjFunction · 0.92
NewDefaultConfigFunction · 0.92
NewHandlerFunction · 0.92
handlerMethod · 0.80

Tested by

no test coverage detected