Explorar o código

fix tests

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Victor Vieux %!s(int64=11) %!d(string=hai) anos
pai
achega
964d82d005
Modificáronse 3 ficheiros con 4 adicións e 3 borrados
  1. 2 2
      api/server.go
  2. 1 0
      integration/api_test.go
  3. 1 1
      integration/server_test.go

+ 2 - 2
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
 }

+ 1 - 0
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"

+ 1 - 1
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)
 	}
 }