1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Fixing statusCode checks for sockRequest

Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
This commit is contained in:
Megan Kostick
2015-04-20 14:03:56 -07:00
parent b830b823cd
commit c7845e27ee
12 changed files with 165 additions and 199 deletions

View File

@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"net/http"
"os/exec"
"strings"
@ -26,10 +27,9 @@ func (s *DockerSuite) TestInspectApiContainerResponse(c *check.C) {
if testVersion != "latest" {
endpoint = "/" + testVersion + endpoint
}
_, body, err := sockRequest("GET", endpoint, nil)
if err != nil {
c.Fatalf("sockRequest failed for %s version: %v", testVersion, err)
}
status, body, err := sockRequest("GET", endpoint, nil)
c.Assert(status, check.Equals, http.StatusOK)
c.Assert(err, check.IsNil)
var inspectJSON map[string]interface{}
if err = json.Unmarshal(body, &inspectJSON); err != nil {