mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-10 23:12:41 +08:00
refactor: move hrp/ to root folder
This commit is contained in:
21
pkg/convert/to_pytest.go
Normal file
21
pkg/convert/to_pytest.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package convert
|
||||
|
||||
import (
|
||||
"github.com/httprunner/funplugin/myexec"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// 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