mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
fix: check testcase format
This commit is contained in:
@@ -221,7 +221,7 @@ func TestLoadTestCases(t *testing.T) {
|
|||||||
if !assert.Nil(t, err) {
|
if !assert.Nil(t, err) {
|
||||||
t.Fatal()
|
t.Fatal()
|
||||||
}
|
}
|
||||||
if !assert.Equal(t, len(testCases), 4) {
|
if !assert.Equal(t, 4, len(testCases)) {
|
||||||
t.Fatal()
|
t.Fatal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,14 +60,17 @@ func (path *TestCasePath) ToTestCase() (*TestCase, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if tc.Config == nil {
|
if tc.TestSteps == nil {
|
||||||
tc.Config = &TConfig{Name: "testcase name"}
|
return nil, errors.New("invalid testcase format, missing teststeps!")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tc.MakeCompat()
|
err = tc.MakeCompat()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
if tc.Config == nil {
|
||||||
|
tc.Config = &TConfig{Name: "please input testcase name"}
|
||||||
|
}
|
||||||
tc.Config.Path = casePath
|
tc.Config.Path = casePath
|
||||||
|
|
||||||
testCase := &TestCase{
|
testCase := &TestCase{
|
||||||
|
|||||||
Reference in New Issue
Block a user