Merge branch 'main-dmdb' into master

This commit is contained in:
2026-07-13 15:21:25 +08:00
+16
View File
@@ -71,6 +71,22 @@ func (a *Api) AtPath(path string) *Api {
}
}
// RunSub 在单个接口测试 Func 内再分子场景,便于 go test -run 收窄。
func (a *Api) RunSub(desc string, fn func(a *Api)) {
if a == nil || a.t == nil {
fn(a)
return
}
a.t.Run(desc, func(t *testing.T) {
fn(&Api{
app: a.app,
path: a.path,
t: t,
session: a.session,
})
})
}
// JSON 设置 JSON body,返回 ApiCase 构建器
func (a *Api) JSON(body interface{}) *ApiCase {
c := a.newCase()