mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
refactor: convert postman case
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package convert
|
||||
|
||||
import (
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/myexec"
|
||||
)
|
||||
|
||||
// convert TCase to pytest case
|
||||
func (c *TCaseConverter) toPyTest() (string, error) {
|
||||
jsonPath, err := c.toJSON()
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "convert to JSON case failed")
|
||||
}
|
||||
|
||||
args := append([]string{"make"}, jsonPath)
|
||||
err = myexec.ExecPython3Command("httprunner", args...)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return c.genOutputPath(suffixPyTest), nil
|
||||
}
|
||||
Reference in New Issue
Block a user