瀏覽代碼

Fix errors due changed sockRequest signature

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Alexander Morozov 10 年之前
父節點
當前提交
27fccdbabb
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 5 1
      integration-cli/docker_api_exec_resize_test.go
  2. 5 1
      integration-cli/docker_api_resize_test.go

+ 5 - 1
integration-cli/docker_api_exec_resize_test.go

@@ -1,6 +1,7 @@
 package main
 
 import (
+	"net/http"
 	"os/exec"
 	"strings"
 	"testing"
@@ -16,10 +17,13 @@ func TestExecResizeApiHeightWidthNoInt(t *testing.T) {
 	cleanedContainerID := strings.TrimSpace(out)
 
 	endpoint := "/exec/" + cleanedContainerID + "/resize?h=foo&w=bar"
-	_, err = sockRequest("POST", endpoint, nil)
+	status, _, err := sockRequest("POST", endpoint, nil)
 	if err == nil {
 		t.Fatal("Expected exec resize Request to fail")
 	}
+	if status != http.StatusInternalServerError {
+		t.Fatalf("Status expected %d, got %d", http.StatusInternalServerError, status)
+	}
 
 	logDone("container exec resize - height, width no int fail")
 }

+ 5 - 1
integration-cli/docker_api_resize_test.go

@@ -1,6 +1,7 @@
 package main
 
 import (
+	"net/http"
 	"os/exec"
 	"strings"
 	"testing"
@@ -34,10 +35,13 @@ func TestResizeApiHeightWidthNoInt(t *testing.T) {
 	cleanedContainerID := strings.TrimSpace(out)
 
 	endpoint := "/containers/" + cleanedContainerID + "/resize?h=foo&w=bar"
-	_, err = sockRequest("POST", endpoint, nil)
+	status, _, err := sockRequest("POST", endpoint, nil)
 	if err == nil {
 		t.Fatal("Expected resize Request to fail")
 	}
+	if status != http.StatusInternalServerError {
+		t.Fatalf("Status expected %d, got %d", http.StatusInternalServerError, status)
+	}
 
 	logDone("container resize - height, width no int fail")
 }