From 964d82d00506c3005d102b9a1f94848182c5989d Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Tue, 18 Feb 2014 01:44:53 +0000 Subject: [PATCH] fix tests Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- api/server.go | 4 ++-- integration/api_test.go | 1 + integration/server_test.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/server.go b/api/server.go index 007c07ddb..1019521e0 100644 --- a/api/server.go +++ b/api/server.go @@ -1057,13 +1057,13 @@ func createRouter(eng *engine.Engine, logging, enableCors bool, dockerVersion st // ServeRequest processes a single http request to the docker remote api. // FIXME: refactor this to be part of Server and not require re-creating a new // router each time. This requires first moving ListenAndServe into Server. -func ServeRequest(eng *engine.Engine, apiversion float64, w http.ResponseWriter, req *http.Request) error { +func ServeRequest(eng *engine.Engine, apiversion string, w http.ResponseWriter, req *http.Request) error { router, err := createRouter(eng, false, true, "") if err != nil { return err } // Insert APIVERSION into the request as a convenience - req.URL.Path = fmt.Sprintf("/v%g%s", apiversion, req.URL.Path) + req.URL.Path = fmt.Sprintf("/v%s%s", apiversion, req.URL.Path) router.ServeHTTP(w, req) return nil } diff --git a/integration/api_test.go b/integration/api_test.go index abbc1a1c5..4c22d54b3 100644 --- a/integration/api_test.go +++ b/integration/api_test.go @@ -13,6 +13,7 @@ import ( "github.com/dotcloud/docker/runconfig" "github.com/dotcloud/docker/utils" "io" + "io/ioutil" "net" "net/http" "net/http/httptest" diff --git a/integration/server_test.go b/integration/server_test.go index 8600e7857..2fe16551d 100644 --- a/integration/server_test.go +++ b/integration/server_test.go @@ -691,7 +691,7 @@ func TestDeleteTagWithExistingContainers(t *testing.T) { t.Fatalf("Should only have deleted one untag %d", len(imgs.Data)) } - if untag := imgs.Data[0].Get("Untagged"); untag != unitTestImageID { + if untag := imgs.Data[0].Get("Untagged"); untag != "utest:tag1" { t.Fatalf("Expected %s got %s", unitTestImageID, untag) } }