MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / withEnabledQueue

Function withEnabledQueue

internal/redisqueue/plugin_test.go:202–219  ·  view source on GitHub ↗
(t *testing.T, fn func())

Source from the content-addressed store, hash-verified

200}
201
202func withEnabledQueue(t *testing.T, fn func()) {
203 t.Helper()
204
205 prevQueueEnabled := Enabled()
206 prevUsageEnabled := UsageStatisticsEnabled()
207
208 SetEnabled(false)
209 SetEnabled(true)
210 SetUsageStatisticsEnabled(true)
211
212 defer func() {
213 SetEnabled(false)
214 SetEnabled(prevQueueEnabled)
215 SetUsageStatisticsEnabled(prevUsageEnabled)
216 }()
217
218 fn()
219}
220
221func newTestGinContext(t *testing.T, method, path string, status int) *gin.Context {
222 t.Helper()

Calls 4

EnabledFunction · 0.85
UsageStatisticsEnabledFunction · 0.85
SetEnabledFunction · 0.85

Tested by

no test coverage detected