From 5680d7b8b77cbe544737a06cbf7d4e562c40ab78 Mon Sep 17 00:00:00 2001 From: Hu Keping Date: Fri, 5 Jun 2015 00:23:11 +0800 Subject: [PATCH] Test: add test for health/check Signed-off-by: Hu Keping --- health/checks/checks_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 health/checks/checks_test.go diff --git a/health/checks/checks_test.go b/health/checks/checks_test.go new file mode 100644 index 00000000..8f3ffbff --- /dev/null +++ b/health/checks/checks_test.go @@ -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) + } +}