mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
client: test httpKeysAPI's Create and Update methods
This commit is contained in:
parent
115e758c32
commit
943c7ef307
@ -1151,3 +1151,31 @@ func TestHTTPKeysAPIDeleteResponse(t *testing.T) {
|
|||||||
t.Errorf("incorrect Response: want=%#v got=%#v", wantResponse, resp)
|
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")
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user