Signed-off-by: Alexander Morozov <lk4d4@docker.com>
| ... | ... |
@@ -1,6 +1,7 @@ |
| 1 | 1 |
package main |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 |
+ "net/http" |
|
| 4 | 5 |
"os/exec" |
| 5 | 6 |
"strings" |
| 6 | 7 |
"testing" |
| ... | ... |
@@ -16,10 +17,13 @@ func TestExecResizeApiHeightWidthNoInt(t *testing.T) {
|
| 16 | 16 |
cleanedContainerID := strings.TrimSpace(out) |
| 17 | 17 |
|
| 18 | 18 |
endpoint := "/exec/" + cleanedContainerID + "/resize?h=foo&w=bar" |
| 19 |
- _, err = sockRequest("POST", endpoint, nil)
|
|
| 19 |
+ status, _, err := sockRequest("POST", endpoint, nil)
|
|
| 20 | 20 |
if err == nil {
|
| 21 | 21 |
t.Fatal("Expected exec resize Request to fail")
|
| 22 | 22 |
} |
| 23 |
+ if status != http.StatusInternalServerError {
|
|
| 24 |
+ t.Fatalf("Status expected %d, got %d", http.StatusInternalServerError, status)
|
|
| 25 |
+ } |
|
| 23 | 26 |
|
| 24 | 27 |
logDone("container exec resize - height, width no int fail")
|
| 25 | 28 |
} |
| ... | ... |
@@ -1,6 +1,7 @@ |
| 1 | 1 |
package main |
| 2 | 2 |
|
| 3 | 3 |
import ( |
| 4 |
+ "net/http" |
|
| 4 | 5 |
"os/exec" |
| 5 | 6 |
"strings" |
| 6 | 7 |
"testing" |
| ... | ... |
@@ -34,10 +35,13 @@ func TestResizeApiHeightWidthNoInt(t *testing.T) {
|
| 34 | 34 |
cleanedContainerID := strings.TrimSpace(out) |
| 35 | 35 |
|
| 36 | 36 |
endpoint := "/containers/" + cleanedContainerID + "/resize?h=foo&w=bar" |
| 37 |
- _, err = sockRequest("POST", endpoint, nil)
|
|
| 37 |
+ status, _, err := sockRequest("POST", endpoint, nil)
|
|
| 38 | 38 |
if err == nil {
|
| 39 | 39 |
t.Fatal("Expected resize Request to fail")
|
| 40 | 40 |
} |
| 41 |
+ if status != http.StatusInternalServerError {
|
|
| 42 |
+ t.Fatalf("Status expected %d, got %d", http.StatusInternalServerError, status)
|
|
| 43 |
+ } |
|
| 41 | 44 |
|
| 42 | 45 |
logDone("container resize - height, width no int fail")
|
| 43 | 46 |
} |