Browse Source

test add integration test

Xiang Li 12 years ago
parent
commit
bd651edf80
1 changed files with 2 additions and 2 deletions
  1. 2 2
      server/v2/tests/get_handler_test.go

+ 2 - 2
server/v2/tests/get_handler_test.go

@@ -42,6 +42,7 @@ func TestV2GetKeyRecursively(t *testing.T) {
 	tests.RunServer(func(s *server.Server) {
 		v := url.Values{}
 		v.Set("value", "XXX")
+		v.Set("ttl", "10")
 		resp, _ := tests.PutForm(fmt.Sprintf("http://%s%s", s.URL(), "/v2/keys/foo/x"), v)
 		tests.ReadBody(resp)
 
@@ -60,6 +61,7 @@ func TestV2GetKeyRecursively(t *testing.T) {
 		kv0 := body["kvs"].([]interface{})[0].(map[string]interface{})
 		assert.Equal(t, kv0["key"], "/foo/x", "")
 		assert.Equal(t, kv0["value"], "XXX", "")
+		assert.Equal(t, kv0["ttl"], 10, "")
 
 		kv1 := body["kvs"].([]interface{})[1].(map[string]interface{})
 		assert.Equal(t, kv1["key"], "/foo/y", "")
@@ -105,7 +107,6 @@ func TestV2WatchKey(t *testing.T) {
 	})
 }
 
-
 // Ensures that a watcher can wait for a value to be set after a given index.
 //
 //   $ curl localhost:4001/v2/keys/foo/bar?wait=true&waitIndex=4
@@ -149,4 +150,3 @@ func TestV2WatchKeyWithIndex(t *testing.T) {
 		assert.Equal(t, body["term"], 0, "")
 	})
 }
-