client: test httpKeysAPI's Create and Update methods

This commit is contained in:
Brian Waldon 2015-01-29 15:48:48 -08:00 committed by Yicheng Qin
parent 115e758c32
commit 943c7ef307

View File

@ -1151,3 +1151,31 @@ func TestHTTPKeysAPIDeleteResponse(t *testing.T) {
t.Errorf("incorrect Response: want=%#v got=%#v", wantResponse, resp)
}
}
func TestHTTPKeysAPICreateAction(t *testing.T) {
act := &setAction{
Key: "/foo",
Value: "bar",
PrevExist: PrevNoExist,
PrevIndex: 0,
PrevValue: "",
TTL: 0,
}
kAPI := httpKeysAPI{client: &actionAssertingHTTPClient{t: t, act: act}}
kAPI.Create(context.Background(), "/foo", "bar")
}
func TestHTTPKeysAPIUpdateAction(t *testing.T) {
act := &setAction{
Key: "/foo",
Value: "bar",
PrevExist: PrevExist,
PrevIndex: 0,
PrevValue: "",
TTL: 0,
}
kAPI := httpKeysAPI{client: &actionAssertingHTTPClient{t: t, act: act}}
kAPI.Update(context.Background(), "/foo", "bar")
}