فهرست منبع

Fix typos whithin unit tests

Guillaume J. Charmes 12 سال پیش
والد
کامیت
483c942520
2فایلهای تغییر یافته به همراه21 افزوده شده و 21 حذف شده
  1. 12 12
      api_test.go
  2. 9 9
      commands.go

+ 12 - 12
api_test.go

@@ -142,7 +142,7 @@ func TestGetImagesJson(t *testing.T) {
 
 
 func TestGetImagesViz(t *testing.T) {
 func TestGetImagesViz(t *testing.T) {
 	//FIXME: Implement this test (or remove this endpoint)
 	//FIXME: Implement this test (or remove this endpoint)
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestGetImagesSearch(t *testing.T) {
 func TestGetImagesSearch(t *testing.T) {
@@ -267,7 +267,7 @@ func TestGetContainersPs(t *testing.T) {
 
 
 func TestGetContainersExport(t *testing.T) {
 func TestGetContainersExport(t *testing.T) {
 	//FIXME: Implement this test
 	//FIXME: Implement this test
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestGetContainerChanges(t *testing.T) {
 func TestGetContainerChanges(t *testing.T) {
@@ -289,9 +289,9 @@ func TestGetContainerChanges(t *testing.T) {
 	// 	t.Fatalf("Body expected, received: nil\n")
 	// 	t.Fatalf("Body expected, received: nil\n")
 	// }
 	// }
 
 
-	// if r.Code != http.StatusOK {
-	// 	t.Fatalf("%d OK expected, received %d\n", http.StatusNoContent, r.Code)
-	// }
+func TestGetContainersByName(t *testing.T) {
+	//FIXME: Implement this test
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostAuth(t *testing.T) {
 func TestPostAuth(t *testing.T) {
@@ -327,32 +327,32 @@ func TestPostAuth(t *testing.T) {
 
 
 func TestPostCommit(t *testing.T) {
 func TestPostCommit(t *testing.T) {
 	//FIXME: Implement this test
 	//FIXME: Implement this test
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostBuild(t *testing.T) {
 func TestPostBuild(t *testing.T) {
 	//FIXME: Implement this test
 	//FIXME: Implement this test
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostImagesCreate(t *testing.T) {
 func TestPostImagesCreate(t *testing.T) {
 	//FIXME: Implement this test
 	//FIXME: Implement this test
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostImagesInsert(t *testing.T) {
 func TestPostImagesInsert(t *testing.T) {
 	//FIXME: Implement this test (or remove this endpoint)
 	//FIXME: Implement this test (or remove this endpoint)
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostImagesPush(t *testing.T) {
 func TestPostImagesPush(t *testing.T) {
 	//FIXME: Implement this test
 	//FIXME: Implement this test
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostImagesTag(t *testing.T) {
 func TestPostImagesTag(t *testing.T) {
 	//FIXME: Implement this test
 	//FIXME: Implement this test
-	t.Log("Test on implemented")
+	t.Log("Test not implemented")
 }
 }
 
 
 func TestPostContainersCreate(t *testing.T) {
 func TestPostContainersCreate(t *testing.T) {
@@ -651,7 +651,7 @@ func TestPostContainersWait(t *testing.T) {
 	}
 	}
 
 
 	setTimeout(t, "Wait timed out", 3*time.Second, func() {
 	setTimeout(t, "Wait timed out", 3*time.Second, func() {
-		body, err := postContainersWait(srv, nil, nil, nil)
+		body, err := postContainersWait(srv, nil, nil, map[string]string{"name": container.Id})
 		if err != nil {
 		if err != nil {
 			t.Fatal(err)
 			t.Fatal(err)
 		}
 		}

+ 9 - 9
commands.go

@@ -844,13 +844,13 @@ func CmdCommit(args ...string) error {
 		return err
 		return err
 	}
 	}
 
 
-	var out ApiId
-	err = json.Unmarshal(body, &out)
+	apiId := &ApiId{}
+	err = json.Unmarshal(body, apiId)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
 
 
-	fmt.Println(out.Id)
+	fmt.Println(apiId.Id)
 	return nil
 	return nil
 }
 }
 
 
@@ -886,7 +886,7 @@ func CmdDiff(args ...string) error {
 		return err
 		return err
 	}
 	}
 
 
-	var changes []Change
+	changes := []Change{}
 	err = json.Unmarshal(body, &changes)
 	err = json.Unmarshal(body, &changes)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
@@ -933,8 +933,8 @@ func CmdAttach(args ...string) error {
 		return err
 		return err
 	}
 	}
 
 
-	var container Container
-	err = json.Unmarshal(body, &container)
+	container := &Container{}
+	err = json.Unmarshal(body, container)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}
@@ -968,7 +968,7 @@ func CmdSearch(args ...string) error {
 		return err
 		return err
 	}
 	}
 
 
-	var outs []ApiSearch
+	outs := []ApiSearch{}
 	err = json.Unmarshal(body, &outs)
 	err = json.Unmarshal(body, &outs)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
@@ -1100,8 +1100,8 @@ func CmdRun(args ...string) error {
 		return err
 		return err
 	}
 	}
 
 
-	var out ApiRun
-	err = json.Unmarshal(body, &out)
+	out := &ApiRun{}
+	err = json.Unmarshal(body, out)
 	if err != nil {
 	if err != nil {
 		return err
 		return err
 	}
 	}