Test: add test for HTTPChecker

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
Hu Keping 2015-06-10 01:39:34 +08:00
parent f63313de1f
commit 5d5caa0e9a
1 changed files with 10 additions and 0 deletions

View File

@ -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)
}
}