refactor: convert API

This commit is contained in:
debugtalk
2021-10-11 11:30:31 +08:00
parent c86aaa2555
commit d0a819b5a4
5 changed files with 32 additions and 32 deletions

View File

@@ -56,12 +56,13 @@ var (
)
func TestMain(m *testing.M) {
tCase, _ := demoTestCase.ToTCase()
// setup, prepare demo json/yaml testcase file path
err := demoTestCase.dump2JSON(demoTestCaseJSONPath)
err := tCase.Dump2JSON(demoTestCaseJSONPath)
if err != nil {
os.Exit(1)
}
err = demoTestCase.dump2YAML(demoTestCaseYAMLPath)
err = tCase.Dump2YAML(demoTestCaseYAMLPath)
if err != nil {
os.Exit(1)
}
@@ -118,7 +119,7 @@ func TestLoadYAMLCase(t *testing.T) {
func TestLoadJSONAndRun(t *testing.T) {
jsonPath := &TestCasePath{demoTestCaseJSONPath}
testcase, err := loadTestFile(jsonPath)
testcase, err := jsonPath.ToTestCase()
if !assert.NoError(t, err) {
t.Fail()
}