Browse Source

client: test httpClusterClient.reset failure cases

Brian Waldon 11 years ago
parent
commit
99aa0e1fcc
1 changed files with 18 additions and 0 deletions
  1. 18 0
      client/client_test.go

+ 18 - 0
client/client_test.go

@@ -636,3 +636,21 @@ func TestHTTPClusterClientSyncFail(t *testing.T) {
 		t.Fatalf("incorrect endpoints after failed Sync: want=%#v got=%#v", want, got)
 		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)
+		}
+	}
+}