feat: run tsetcase by path

This commit is contained in:
debugtalk
2021-10-10 00:22:26 +08:00
parent ab85a78e47
commit e49d2a1b9c
6 changed files with 84 additions and 12 deletions

View File

@@ -50,7 +50,7 @@ var demoTestCase = &TestCase{
}
func TestDumpAndLoadJSON(t *testing.T) {
jsonPath := "demo.json"
jsonPath := demoTestCaseJSONPath
err := demoTestCase.dump2JSON(jsonPath)
if !assert.NoError(t, err) {
t.Fail()
@@ -94,13 +94,11 @@ func TestDumpAndLoadYAML(t *testing.T) {
}
}
var demoTestCaseJSONPath = "demo.json"
func TestLoadJSONAndRun(t *testing.T) {
jsonPath := "demo.json"
tc, err := loadFromJSON(jsonPath)
if !assert.NoError(t, err) {
t.Fail()
}
testcase, err := convertTestCase(tc)
jsonPath := &TestCasePath{demoTestCaseJSONPath}
testcase, err := loadTestFile(jsonPath)
if !assert.NoError(t, err) {
t.Fail()
}