refactor: move uixt pkg

This commit is contained in:
lilong.129
2025-03-05 11:04:02 +08:00
parent 9e064ee0ad
commit e107389d6e
122 changed files with 146 additions and 142 deletions
+26
View File
@@ -0,0 +1,26 @@
package convert
import (
"reflect"
hrp "github.com/httprunner/httprunner/v5"
"github.com/pkg/errors"
)
func LoadYAMLCase(path string) (*hrp.TestCaseDef, error) {
// load yaml case file
caseJSON := new(hrp.TestCaseDef)
err := hrp.LoadFileObject(path, caseJSON)
if err != nil {
return nil, errors.Wrap(err, "load yaml file failed")
}
if reflect.ValueOf(*caseJSON).IsZero() {
return nil, errors.New("invalid yaml file")
}
err = hrp.ConvertCaseCompatibility(caseJSON)
if err != nil {
return nil, err
}
return caseJSON, nil
}