mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 10:29:39 +08:00
update unittests.
This commit is contained in:
@@ -148,7 +148,7 @@ func (s *requestStats) collectReportData() map[string]interface{} {
|
||||
"failed": s.transactionFailed,
|
||||
}
|
||||
data["stats"] = s.serializeStats()
|
||||
data["stats_total"] = s.total.getReport()
|
||||
data["stats_total"] = s.total.serialize()
|
||||
data["errors"] = s.serializeErrors()
|
||||
s.errors = make(map[string]*statsError)
|
||||
return data
|
||||
@@ -294,11 +294,6 @@ func (s *statsEntry) getStrippedReport() map[string]interface{} {
|
||||
return report
|
||||
}
|
||||
|
||||
func (s *statsEntry) getReport() map[string]interface{} {
|
||||
report := s.serialize()
|
||||
return report
|
||||
}
|
||||
|
||||
type statsError struct {
|
||||
name string
|
||||
method string
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package scaffold
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"testing"
|
||||
@@ -43,35 +42,35 @@ func TestGenDemoTestCase(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func Example_demo() {
|
||||
func TestExampleDemo(t *testing.T) {
|
||||
buildHashicorpPlugin()
|
||||
defer removeHashicorpPlugin()
|
||||
|
||||
demoTestCase.Config.ToStruct().Path = "../../examples/debugtalk.bin"
|
||||
err := hrp.NewRunner(nil).Run(demoTestCase) // hrp.Run(demoTestCase)
|
||||
fmt.Println(err)
|
||||
// Output:
|
||||
// <nil>
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func Example_jsonDemo() {
|
||||
func TestJsonDemo(t *testing.T) {
|
||||
buildHashicorpPlugin()
|
||||
defer removeHashicorpPlugin()
|
||||
|
||||
testCase := &hrp.TestCasePath{Path: demoTestCaseJSONPath}
|
||||
err := hrp.NewRunner(nil).Run(testCase) // hrp.Run(testCase)
|
||||
fmt.Println(err)
|
||||
// Output:
|
||||
// <nil>
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func Example_yamlDemo() {
|
||||
func TestYamlDemo(t *testing.T) {
|
||||
buildHashicorpPlugin()
|
||||
defer removeHashicorpPlugin()
|
||||
|
||||
testCase := &hrp.TestCasePath{Path: demoTestCaseYAMLPath}
|
||||
err := hrp.NewRunner(nil).Run(testCase) // hrp.Run(testCase)
|
||||
fmt.Println(err)
|
||||
// Output:
|
||||
// <nil>
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user