update unittests.

This commit is contained in:
徐聪
2022-01-19 20:51:00 +08:00
parent ee5e8a971c
commit 30f77d1ff8
2 changed files with 13 additions and 19 deletions

View File

@@ -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

View File

@@ -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()
}
}