client: test httpClusterClient.reset failure cases

This commit is contained in:
Brian Waldon 2015-01-29 16:24:37 -08:00 committed by Yicheng Qin
parent ed173a2a76
commit 99aa0e1fcc

View File

@ -636,3 +636,21 @@ func TestHTTPClusterClientSyncFail(t *testing.T) {
t.Fatalf("incorrect endpoints after failed Sync: want=%#v got=%#v", want, got)
}
}
func TestHTTPClusterClientResetFail(t *testing.T) {
tests := [][]string{
// need at least one endpoint
[]string{},
// urls must be valid
[]string{":"},
}
for i, tt := range tests {
hc := &httpClusterClient{}
err := hc.reset(tt)
if err == nil {
t.Errorf("#%d: expected non-nil error", i)
}
}
}