MCPcopy
hub / github.com/httprunner/httprunner / LoadJSONCase

Function LoadJSONCase

hrp/pkg/convert/from_json.go:11–28  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

9)
10
11func LoadJSONCase(path string) (*hrp.TCase, error) {
12 log.Info().Str("path", path).Msg("load json case file")
13 caseJSON := new(hrp.TCase)
14 err := builtin.LoadFile(path, caseJSON)
15 if err != nil {
16 return nil, errors.Wrap(err, "load json file failed")
17 }
18
19 if caseJSON.TestSteps == nil {
20 return nil, errors.New("invalid json case file, missing teststeps")
21 }
22
23 err = caseJSON.MakeCompat()
24 if err != nil {
25 return nil, err
26 }
27 return caseJSON, nil
28}

Callers 1

loadCaseMethod · 0.85

Calls 2

LoadFileFunction · 0.92
MakeCompatMethod · 0.80

Tested by

no test coverage detected