mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-08 17:29:34 +08:00
fix example JSON/YAML file path
This commit is contained in:
@@ -6,8 +6,9 @@ import (
|
|||||||
"github.com/httprunner/hrp"
|
"github.com/httprunner/hrp"
|
||||||
)
|
)
|
||||||
|
|
||||||
const demoHttpRunnerJSONPath = "../examples/demo_httprunner.json"
|
// generated by examples/har/demo.har using HttpRunner v3.1.6
|
||||||
const demoHttpRunnerYAMLPath = "../examples/demo_httprunner.yaml"
|
const demoHttpRunnerJSONPath = "demo_httprunner.json"
|
||||||
|
const demoHttpRunnerYAMLPath = "demo_httprunner.yaml"
|
||||||
|
|
||||||
func TestCompatTestCase(t *testing.T) {
|
func TestCompatTestCase(t *testing.T) {
|
||||||
testcaseFromJSON := &hrp.TestCasePath{Path: demoHttpRunnerJSONPath}
|
testcaseFromJSON := &hrp.TestCasePath{Path: demoHttpRunnerJSONPath}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import (
|
|||||||
"github.com/httprunner/hrp/internal/builtin"
|
"github.com/httprunner/hrp/internal/builtin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const rendezvousTestJSONPath = "rendezvous_test.json"
|
||||||
|
|
||||||
var rendezvousTestcase = &hrp.TestCase{
|
var rendezvousTestcase = &hrp.TestCase{
|
||||||
Config: hrp.NewConfig("run request with functions").
|
Config: hrp.NewConfig("run request with functions").
|
||||||
SetBaseURL("https://postman-echo.com").
|
SetBaseURL("https://postman-echo.com").
|
||||||
@@ -59,7 +61,7 @@ func TestRendezvousDump2JSON(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("ToTCase error: %v", err)
|
t.Fatalf("ToTCase error: %v", err)
|
||||||
}
|
}
|
||||||
err = builtin.Dump2JSON(tCase, "rendezvous_test.json")
|
err = builtin.Dump2JSON(tCase, rendezvousTestJSONPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("dump to json error: %v", err)
|
t.Fatalf("dump to json error: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user