Browse code

Merge pull request #909 from dotcloud/fix_auth_tests

Fix the auth tests

Guillaume J. Charmes authored on 2013/06/21 02:14:55
Showing 1 changed files
... ...
@@ -10,8 +10,8 @@ import (
10 10
 
11 11
 func TestEncodeAuth(t *testing.T) {
12 12
 	newAuthConfig := &AuthConfig{Username: "ken", Password: "test", Email: "test@example.com"}
13
-	authStr := EncodeAuth(newAuthConfig)
14
-	decAuthConfig, err := DecodeAuth(authStr)
13
+	authStr := encodeAuth(newAuthConfig)
14
+	decAuthConfig, err := decodeAuth(authStr)
15 15
 	if err != nil {
16 16
 		t.Fatal(err)
17 17
 	}
... ...
@@ -30,7 +30,7 @@ func TestLogin(t *testing.T) {
30 30
 	os.Setenv("DOCKER_INDEX_URL", "https://indexstaging-docker.dotcloud.com")
31 31
 	defer os.Setenv("DOCKER_INDEX_URL", "")
32 32
 	authConfig := NewAuthConfig("unittester", "surlautrerivejetattendrai", "noise+unittester@dotcloud.com", "/tmp")
33
-	status, err := Login(authConfig)
33
+	status, err := Login(authConfig, false)
34 34
 	if err != nil {
35 35
 		t.Fatal(err)
36 36
 	}
... ...
@@ -50,7 +50,7 @@ func TestCreateAccount(t *testing.T) {
50 50
 	token := hex.EncodeToString(tokenBuffer)[:12]
51 51
 	username := "ut" + token
52 52
 	authConfig := NewAuthConfig(username, "test42", "docker-ut+"+token+"@example.com", "/tmp")
53
-	status, err := Login(authConfig)
53
+	status, err := Login(authConfig, false)
54 54
 	if err != nil {
55 55
 		t.Fatal(err)
56 56
 	}
... ...
@@ -60,7 +60,7 @@ func TestCreateAccount(t *testing.T) {
60 60
 		t.Fatalf("Expected status: \"%s\", found \"%s\" instead.", expectedStatus, status)
61 61
 	}
62 62
 
63
-	status, err = Login(authConfig)
63
+	status, err = Login(authConfig, false)
64 64
 	if err == nil {
65 65
 		t.Fatalf("Expected error but found nil instead")
66 66
 	}