forked from TrueCloudLab/distribution
Merge pull request #612 from HuKeping/addtest-httpchecker
Test: add test for HTTPChecker
This commit is contained in:
commit
7363323321
1 changed files with 10 additions and 0 deletions
|
@ -13,3 +13,13 @@ func TestFileChecker(t *testing.T) {
|
||||||
t.Errorf("NoSuchFileFromMoon was expected as not exists, error:%v", err)
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue