mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
tests fix all tests
This commit is contained in:
@@ -24,7 +24,7 @@ func TestV2CreateUnique(t *testing.T) {
|
||||
|
||||
node := body["node"].(map[string]interface{})
|
||||
assert.Equal(t, node["key"], "/foo/bar/2", "")
|
||||
assert.Equal(t, node["dir"], true, "")
|
||||
assert.Nil(t, node["dir"], "")
|
||||
assert.Equal(t, node["modifiedIndex"], 2, "")
|
||||
|
||||
// Second POST should add next index to list.
|
||||
|
||||
@@ -126,12 +126,13 @@ func TestV2UpdateKeySuccess(t *testing.T) {
|
||||
|
||||
// Ensures that a key is not conditionally set if it previously did not exist.
|
||||
//
|
||||
// $ curl -X PUT localhost:4001/v2/keys/foo?dir=true
|
||||
// $ curl -X PUT localhost:4001/v2/keys/foo/bar -d value=XXX -d prevExist=true
|
||||
//
|
||||
func TestV2UpdateKeyFailOnValue(t *testing.T) {
|
||||
tests.RunServer(func(s *server.Server) {
|
||||
v := url.Values{}
|
||||
resp, _ := tests.PutForm(fmt.Sprintf("%s%s", s.URL(), "/v2/keys/foo"), v)
|
||||
resp, _ := tests.PutForm(fmt.Sprintf("%s%s", s.URL(), "/v2/keys/foo?dir=true"), v)
|
||||
|
||||
v.Set("value", "YYY")
|
||||
v.Set("prevExist", "true")
|
||||
|
||||
Reference in New Issue
Block a user