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

gofmt pass

This commit is contained in:
shin- 2013-05-10 08:52:25 -07:00 committed by Guillaume J. Charmes
parent 6c7dc1de86
commit 17ad00a35e
3 changed files with 11 additions and 12 deletions

View file

@ -26,7 +26,7 @@ func TestEncodeAuth(t *testing.T) {
}
}
func TestLogin(t* testing.T) {
func TestLogin(t *testing.T) {
os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
defer os.Setenv("DOCKER_INDEX_URL", "")
authConfig := NewAuthConfig("unittester", "surlautrerivejetattendrai", "noise+unittester@dotcloud.com", "/tmp")
@ -39,7 +39,7 @@ func TestLogin(t* testing.T) {
}
}
func TestCreateAccount(t* testing.T) {
func TestCreateAccount(t *testing.T) {
os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
defer os.Setenv("DOCKER_INDEX_URL", "")
tokenBuffer := make([]byte, 16)
@ -49,7 +49,7 @@ func TestCreateAccount(t* testing.T) {
}
token := hex.EncodeToString(tokenBuffer)[:12]
username := "ut" + token
authConfig := NewAuthConfig(username, "test42", "docker-ut+" + token + "@example.com", "/tmp")
authConfig := NewAuthConfig(username, "test42", "docker-ut+"+token+"@example.com", "/tmp")
status, err := Login(authConfig)
if err != nil {
t.Fatal(err)
@ -70,4 +70,4 @@ func TestCreateAccount(t* testing.T) {
if !strings.Contains(err.Error(), expectedError) {
t.Fatalf("Expected message \"%s\" but found \"%s\" instead", expectedError, err.Error())
}
}
}

View file

@ -691,7 +691,6 @@ func (graph *Graph) PushRepository(stdout io.Writer, remote string, localRepo Re
}
}
req2, err := http.NewRequest("PUT", auth.IndexServerAddress()+"/repositories/"+remote+"/images", bytes.NewReader(imgListJson))
if err != nil {
return err

View file

@ -9,7 +9,7 @@ import (
"testing"
)
func TestPull(t* testing.T) {
func TestPull(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
@ -45,7 +45,7 @@ func TestPull(t* testing.T) {
}
}
func TestPullTag(t* testing.T) {
func TestPullTag(t *testing.T) {
runtime, err := newTestRuntime()
if err != nil {
t.Fatal(err)
@ -74,7 +74,7 @@ func login(runtime *Runtime) error {
return err
}
func TestPush(t* testing.T) {
func TestPush(t *testing.T) {
os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
defer os.Setenv("DOCKER_INDEX_URL", "")
runtime, err := newTestRuntime()
@ -116,13 +116,13 @@ func TestPush(t* testing.T) {
t.Fatalf("Expected status code 0, found %d instead", status)
}
img, err := b.Commit(container, "unittester/" + token, "", "", "", nil)
img, err := b.Commit(container, "unittester/"+token, "", "", "", nil)
if err != nil {
t.Fatal(err)
}
repo := runtime.repositories.Repositories["unittester/"+token]
err = runtime.graph.PushRepository(os.Stdout, "unittester/" + token, repo, runtime.authConfig)
err = runtime.graph.PushRepository(os.Stdout, "unittester/"+token, repo, runtime.authConfig)
if err != nil {
t.Fatal(err)
}
@ -132,7 +132,7 @@ func TestPush(t* testing.T) {
t.Fatal(err)
}
err = runtime.graph.PullRepository(os.Stdout, "unittester/" + token, "", runtime.repositories, runtime.authConfig)
err = runtime.graph.PullRepository(os.Stdout, "unittester/"+token, "", runtime.repositories, runtime.authConfig)
if err != nil {
t.Fatal(err)
}
@ -145,4 +145,4 @@ func TestPush(t* testing.T) {
if _, err := os.Stat(path.Join(layerPath, token)); err != nil {
t.Fatalf("Error while trying to retrieve token file: %v", err)
}
}
}