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

Method SetupSuite

handlers/stream/handler_test.go:62–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62func (s *HandlerTestSuite) SetupSuite() {
63 s.testData = testutil.NewTestDataProvider(s.T)
64
65 s.rwConf, _ = testutil.NewLazySuiteObj(
66 s,
67 func() (*responsewriter.Config, error) {
68 c := responsewriter.NewDefaultConfig()
69 return &c, nil
70 },
71 )
72
73 s.rwFactory, _ = testutil.NewLazySuiteObj(
74 s,
75 func() (*responsewriter.Factory, error) {
76 return responsewriter.NewFactory(s.rwConf())
77 },
78 )
79
80 s.cookieConf, _ = testutil.NewLazySuiteObj(
81 s,
82 func() (*cookies.Config, error) {
83 c := cookies.NewDefaultConfig()
84 return &c, nil
85 },
86 )
87
88 s.ctx, _ = testutil.NewLazySuiteObj(
89 s,
90 func() (*Ctx, error) {
91 fc := fetcher.NewDefaultConfig()
92 fc.Transport.HTTP.AllowLoopbackSourceAddresses = true
93
94 fetcher, err := fetcher.New(&fc)
95 if err != nil {
96 return nil, err
97 }
98
99 mc := monitoring.NewDefaultConfig()
100 monitoring, err := monitoring.New(s.T().Context(), &mc, 1)
101 if err != nil {
102 return nil, err
103 }
104
105 cookies, err := cookies.New(s.cookieConf())
106 if err != nil {
107 return nil, err
108 }
109
110 return &Ctx{
111 fetcher: fetcher,
112 monitoring: monitoring,
113 cookies: cookies,
114 }, nil
115 },
116 )
117
118 s.config, _ = testutil.NewLazySuiteObj(
119 s,

Callers

nothing calls this directly

Calls 15

NewTestDataProviderFunction · 0.92
NewLazySuiteObjFunction · 0.92
NewDefaultConfigFunction · 0.92
NewFactoryFunction · 0.92
NewDefaultConfigFunction · 0.92
NewDefaultConfigFunction · 0.92
NewFunction · 0.92
NewDefaultConfigFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
NewDefaultConfigFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected