1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

gofmt_test

This commit is contained in:
Victor Vieux 2013-11-18 11:25:13 -08:00
parent 457375ea37
commit ed8f75d25c
4 changed files with 158 additions and 168 deletions

View file

@ -17,4 +17,3 @@ func TestJsonContentType(t *testing.T) {
t.Fail()
}
}

View file

@ -17,7 +17,6 @@ import (
"time"
)
func TestGetVersion(t *testing.T) {
eng := NewTestEngine(t)
defer mkRuntimeFromEngine(eng, t).Nuke()
@ -45,7 +44,6 @@ func TestGetVersion(t *testing.T) {
}
}
func TestGetInfo(t *testing.T) {
eng := NewTestEngine(t)
defer mkRuntimeFromEngine(eng, t).Nuke()
@ -185,7 +183,6 @@ func TestGetImagesJSON(t *testing.T) {
}
assertHttpNotError(r2, t)
images2 := []docker.APIImages{}
if err := json.Unmarshal(r2.Body.Bytes(), &images2); err != nil {
t.Fatal(err)
@ -346,7 +343,7 @@ func TestGetContainersExport(t *testing.T) {
r := httptest.NewRecorder()
req, err := http.NewRequest("GET", "/containers/" + containerID + "/export", nil)
req, err := http.NewRequest("GET", "/containers/"+containerID+"/export", nil)
if err != nil {
t.Fatal(err)
}

View file

@ -1,9 +1,9 @@
package docker
import (
"github.com/dotcloud/docker/auth"
"crypto/rand"
"encoding/hex"
"github.com/dotcloud/docker/auth"
"os"
"strings"
"testing"
@ -27,8 +27,6 @@ func TestLogin(t *testing.T) {
}
}
func TestCreateAccount(t *testing.T) {
os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
defer os.Setenv("DOCKER_INDEX_URL", "")

View file

@ -3,10 +3,10 @@ package docker
import (
"archive/tar"
"bytes"
"fmt"
"github.com/dotcloud/docker"
"github.com/dotcloud/docker/engine"
"github.com/dotcloud/docker/utils"
"fmt"
"io"
"io/ioutil"
"net/http"
@ -64,7 +64,6 @@ func startContainer(eng *engine.Engine, id string, t utils.Fataler) {
}
}
func containerRun(eng *engine.Engine, id string, t utils.Fataler) {
startContainer(eng, id, t)
containerWait(eng, id, t)
@ -97,12 +96,10 @@ func containerAttach(eng *engine.Engine, id string, t utils.Fataler) (io.WriteCl
return i, o
}
func containerWait(eng *engine.Engine, id string, t utils.Fataler) int {
return getContainer(eng, id, t).Wait()
}
func containerWaitTimeout(eng *engine.Engine, id string, t utils.Fataler) error {
return getContainer(eng, id, t).WaitTimeout(500 * time.Millisecond)
}
@ -137,7 +134,6 @@ func assertHttpNotError(r *httptest.ResponseRecorder, t utils.Fataler) {
}
}
// assertHttpError expect the given response to have an error.
// Otherwise the it causes the test to fail.
func assertHttpError(r *httptest.ResponseRecorder, t utils.Fataler) {