mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-02 14:29:44 +08:00
fix: unittest with failfast
This commit is contained in:
@@ -10,36 +10,36 @@ func TestLocateFile(t *testing.T) {
|
||||
// specify target file path
|
||||
_, err := locateFile(templatesDir+"plugin/debugtalk.go", "debugtalk.go")
|
||||
if !assert.Nil(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
// specify path with the same dir
|
||||
_, err = locateFile(templatesDir+"plugin/debugtalk.py", "debugtalk.go")
|
||||
if !assert.Nil(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
// specify target file path dir
|
||||
_, err = locateFile(templatesDir+"plugin/", "debugtalk.go")
|
||||
if !assert.Nil(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
// specify wrong path
|
||||
_, err = locateFile(".", "debugtalk.go")
|
||||
if !assert.Error(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
_, err = locateFile("/abc", "debugtalk.go")
|
||||
if !assert.Error(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocatePythonPlugin(t *testing.T) {
|
||||
_, err := locatePlugin(templatesDir + "plugin/debugtalk.py")
|
||||
if !assert.Nil(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,6 @@ func TestLocateGoPlugin(t *testing.T) {
|
||||
|
||||
_, err := locatePlugin(templatesDir + "debugtalk.bin")
|
||||
if !assert.Nil(t, err) {
|
||||
t.Fail()
|
||||
t.Fatal()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user