зеркало из https://github.com/microsoft/docker.git
fix tests
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
Родитель
c7f825c0f0
Коммит
964d82d005
|
@ -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
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/dotcloud/docker/runconfig"
|
||||
"github.com/dotcloud/docker/utils"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче