From 5d5caa0e9aac58363093e51e8f1053622790ab1f Mon Sep 17 00:00:00 2001 From: Hu Keping Date: Wed, 10 Jun 2015 01:39:34 +0800 Subject: [PATCH] Test: add test for HTTPChecker Signed-off-by: Hu Keping --- health/checks/checks_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/health/checks/checks_test.go b/health/checks/checks_test.go index 8f3ffbff..4e49d118 100644 --- a/health/checks/checks_test.go +++ b/health/checks/checks_test.go @@ -13,3 +13,13 @@ func TestFileChecker(t *testing.T) { t.Errorf("NoSuchFileFromMoon was expected as not exists, error:%v", err) } } + +func TestHTTPChecker(t *testing.T) { + if err := HTTPChecker("https://www.google.cybertron").Check(); err == nil { + t.Errorf("Google on Cybertron was expected as not exists") + } + + if err := HTTPChecker("https://www.google.pt").Check(); err != nil { + t.Errorf("Google at Portugal was expected as exists, error:%v", err) + } +}