mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 06:12:43 +08:00
22 lines
475 B
Go
22 lines
475 B
Go
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
|
|
}
|