MCPcopy Create free account
hub / github.com/chanify/chanify / TestLuaCheckHttpBody

Function TestLuaCheckHttpBody

core/webhook_test.go:166–176  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestLuaCheckHttpBody(t *testing.T) {
167 l := lua.NewState()
168 defer l.Close()
169 w := httptest.NewRecorder()
170 ctx, _ := gin.CreateTestContext(w)
171 ctx.Set(gin.BodyBytesKey, []byte("{}"))
172 initHttpLua(l, ctx)
173 if err := l.DoString(`ctx:request():body()`); err != nil {
174 t.Fatal(err)
175 }
176}
177
178func TestLuaContextSend(t *testing.T) {
179 c := New()

Callers

nothing calls this directly

Calls 2

initHttpLuaFunction · 0.85
CloseMethod · 0.65

Tested by

no test coverage detected