forked from TrueCloudLab/distribution
Merge pull request #595 from HuKeping/addtest
Test: add test for health/check
This commit is contained in:
commit
bd535a882d
1 changed files with 15 additions and 0 deletions
15
health/checks/checks_test.go
Normal file
15
health/checks/checks_test.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package checks
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFileChecker(t *testing.T) {
|
||||||
|
if err := FileChecker("/tmp").Check(); err == nil {
|
||||||
|
t.Errorf("/tmp was expected as exists")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := FileChecker("NoSuchFileFromMoon").Check(); err != nil {
|
||||||
|
t.Errorf("NoSuchFileFromMoon was expected as not exists, error:%v", err)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue