Esempio n. 1
0
func TestLogin(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)
	client := client.Client{HTTPClient: httpClient, ControllerURL: *u}

	actual, err := Login(&client, "test", "opensesame")

	if err != nil {
		t.Error(err)
	}

	expected := "abc"

	if actual != expected {
		t.Errorf("Expected %s, Got %s", expected, actual)
	}
}
Esempio n. 2
0
func TestCertsList(t *testing.T) {
	t.Parallel()

	expected := []api.Cert{
		api.Cert{
			Name:    "test.example.com",
			Expires: "2014-01-01T00:00:00UTC",
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := List(&client, 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 3
0
func TestListAdmins(t *testing.T) {
	t.Parallel()

	expected := []string{
		"test",
		"foo",
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := ListAdmins(&client, 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 4
0
func TestRollbacker(t *testing.T) {
	t.Parallel()

	expected := 7

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, err := Rollback(&client, "rollbacker", -1)

	if err != nil {
		t.Fatal(err)
	}

	if expected != actual {
		t.Error(fmt.Errorf("Expected %v, Got %v", expected, actual))
	}
}
Esempio n. 5
0
func TestAppsRun(t *testing.T) {
	t.Parallel()

	expected := api.AppRunResponse{
		Output:     "hi\n",
		ReturnCode: 0,
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, err := Run(&client, "example-go", "echo hi")

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 6
0
func TestDomainsAdd(t *testing.T) {
	t.Parallel()

	expected := api.Domain{
		App:     "example-go",
		Created: "2014-01-01T00:00:00UTC",
		Domain:  "example.example.com",
		Owner:   "test",
		Updated: "2014-01-01T00:00:00UTC",
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, err := New(&client, "example-go", "example.example.com")

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Error(fmt.Errorf("Expected %v, Got %v", expected, actual))
	}
}
Esempio n. 7
0
func TestConfigUnset(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	expected := api.Config{
		Owner:   "test",
		App:     "unset-test",
		Values:  map[string]interface{}{},
		Memory:  map[string]interface{}{},
		CPU:     map[string]interface{}{},
		Tags:    map[string]interface{}{},
		Created: "2014-01-01T00:00:00UTC",
		Updated: "2014-01-01T00:00:00UTC",
		UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
	}

	configVars := api.Config{
		Values: map[string]interface{}{
			"TEST": nil,
			"FOO":  nil,
		},
		Memory: map[string]interface{}{
			"web": nil,
		},
		CPU: map[string]interface{}{
			"web": nil,
		},
		Tags: map[string]interface{}{
			"test": nil,
		},
	}

	actual, err := Set(&client, "unset-test", configVars)

	if err != nil {
		t.Error(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 8
0
func TestRegenerate(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)
	client := client.Client{HTTPClient: httpClient, ControllerURL: *u}

	token, err := Regenerate(&client, "", true)

	if err != nil {
		t.Error(err)
	}

	if token != "" {
		t.Errorf("Expected token be empty, Got %s", token)
	}

	token, err = Regenerate(&client, "test", false)

	if err != nil {
		t.Error(err)
	}

	expected := "123"
	if token != expected {
		t.Errorf("Expected %s, Got %s", expected, token)
	}

	token, err = Regenerate(&client, "", false)

	if err != nil {
		t.Error(err)
	}

	expected = "abc"
	if token != expected {
		t.Errorf("Expected %s, Got %s", expected, token)
	}
}
Esempio n. 9
0
func TestBuildsList(t *testing.T) {
	t.Parallel()

	expected := []api.Build{
		api.Build{
			App:        "example-go",
			Created:    "2014-01-01T00:00:00UTC",
			Dockerfile: "FROM deis/slugrunner RUN mkdir -p /app WORKDIR /app ENTRYPOINT [\"/runner/init\"] ADD slug.tgz /app ENV GIT_SHA 060da68f654e75fac06dbedd1995d5f8ad9084db",
			Image:      "example-go",
			Owner:      "test",
			Procfile: map[string]string{
				"web": "example-go",
			},
			Sha:     "060da68f",
			Updated: "2014-01-01T00:00:00UTC",
			UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := List(&client, "example-go", 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Error(fmt.Errorf("Expected %v, Got %v", expected, actual))
	}
}
Esempio n. 10
0
func TestBuildCreate(t *testing.T) {
	t.Parallel()

	expected := api.Build{
		App:     "example-go",
		Created: "2014-01-01T00:00:00UTC",
		Image:   "deis/example-go:latest",
		Owner:   "test",
		Procfile: map[string]string{
			"web": "example-go",
		},
		Updated: "2014-01-01T00:00:00UTC",
		UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	procfile := map[string]string{
		"web": "example-go",
	}

	actual, err := New(&client, "example-go", "deis/example-go", procfile)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Error(fmt.Errorf("Expected %v, Got %v", expected, actual))
	}
}
Esempio n. 11
0
func TestUsersList(t *testing.T) {
	t.Parallel()

	expected := []api.User{
		api.User{
			ID:          1,
			LastLogin:   "******",
			IsSuperuser: true,
			Username:    "******",
			FirstName:   "test",
			LastName:    "testerson",
			Email:       "*****@*****.**",
			IsStaff:     true,
			IsActive:    true,
			DateJoined:  "2014-10-19T22:01:00.601Z",
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := List(&client, 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 12
0
func TestPasswd(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)
	client := client.Client{HTTPClient: httpClient, ControllerURL: *u}

	if err := Passwd(&client, "test", "old", "new"); err != nil {
		t.Error(err)
	}
}
Esempio n. 13
0
func TestProcessesList(t *testing.T) {
	t.Parallel()

	expected := []api.Process{
		api.Process{
			Owner:   "test",
			App:     "example-go",
			Release: "v2",
			Created: "2014-01-01T00:00:00UTC",
			Updated: "2014-01-01T00:00:00UTC",
			UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
			Type:    "web",
			Num:     1,
			State:   "up",
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := List(&client, "example-go", 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Error(fmt.Errorf("Expected %v, Got %v", expected, actual))
	}
}
Esempio n. 14
0
func TestReleasesList(t *testing.T) {
	t.Parallel()

	expected := []api.Release{
		api.Release{
			App:     "example-go",
			Build:   "",
			Config:  "95bd6dea-1685-4f78-a03d-fd7270b058d1",
			Created: "2014-01-01T00:00:00UTC",
			Owner:   "test",
			Summary: "test created initial release",
			Updated: "2014-01-01T00:00:00UTC",
			UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
			Version: 1,
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := List(&client, "example-go", 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Error(fmt.Errorf("Expected %v, Got %v", expected, actual))
	}
}
Esempio n. 15
0
func TestScale(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	if err = Scale(&client, "example-go", map[string]int{"web": 2}); err != nil {
		t.Fatal(err)
	}
}
Esempio n. 16
0
func TestRegister(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u}

	if err = Register(&client, "test", "opensesame", "*****@*****.**"); err != nil {
		t.Error(err)
	}
}
Esempio n. 17
0
func TestDomainsRemove(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	if err = Delete(&client, "example-go", "test.com"); err != nil {
		t.Fatal(err)
	}
}
Esempio n. 18
0
func TestNewAdmin(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	if err = NewAdmin(&client, "test"); err != nil {
		t.Fatal(err)
	}
}
Esempio n. 19
0
func TestAppsLogs(t *testing.T) {
	t.Parallel()

	tests := []testExpected{
		testExpected{
			Input:    -1,
			Expected: "test\nfoo\nbar\n",
		},
		testExpected{
			Input:    1,
			Expected: "test\n",
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	for _, test := range tests {
		actual, err := Logs(&client, "example-go", test.Input)

		if err != nil {
			t.Error(err)
		}

		if actual != test.Expected {
			t.Errorf("Expected %s, Got %s", test.Expected, actual)
		}
	}
}
Esempio n. 20
0
func TestAppsList(t *testing.T) {
	t.Parallel()

	expected := []api.App{
		api.App{
			ID:      "example-go",
			Created: "2014-01-01T00:00:00UTC",
			Owner:   "test",
			Updated: "2014-01-01T00:00:00UTC",
			URL:     "example-go.example.com",
			UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, _, err := List(&client, 100)

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 21
0
func TestAppsCreate(t *testing.T) {
	t.Parallel()

	expected := api.App{
		ID:      "example-go",
		Created: "2014-01-01T00:00:00UTC",
		Owner:   "test",
		Updated: "2014-01-01T00:00:00UTC",
		URL:     "example-go.example.com",
		UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
	}

	handler := fakeHTTPServer{createID: false, createWithoutID: false}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	for _, id := range []string{"example-go", ""} {
		actual, err := New(&client, id)

		if err != nil {
			t.Fatal(err)
		}

		if !reflect.DeepEqual(expected, actual) {
			t.Errorf("Expected %v, Got %v", expected, actual)
		}
	}
}
Esempio n. 22
0
// Login to a Deis controller.
func Login(controller string, username string, password string, sslVerify bool) error {
	u, err := url.Parse(controller)

	if err != nil {
		return err
	}

	controllerURL, err := chooseScheme(*u)
	httpClient := client.CreateHTTPClient(sslVerify)

	if err != nil {
		return err
	}

	if err = client.CheckConnection(httpClient, controllerURL); err != nil {
		return err
	}

	if username == "" {
		fmt.Print("username: "******"" {
		fmt.Print("password: ")
		password, err = readPassword()
		fmt.Println()

		if err != nil {
			return err
		}
	}

	c := &client.Client{ControllerURL: controllerURL, SSLVerify: sslVerify, HTTPClient: httpClient}

	return doLogin(c, username, password)
}
Esempio n. 23
0
func TestDelete(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{cancelUsername: false, cancelEmpty: false}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)
	client := client.Client{HTTPClient: httpClient, ControllerURL: *u}

	if err := Delete(&client, "foo"); err != nil {
		t.Error(err)
	}

	if err := Delete(&client, ""); err != nil {
		t.Error(err)
	}
}
Esempio n. 24
0
func TestDeleteUserApp(t *testing.T) {
	t.Parallel()

	handler := fakeHTTPServer{cancelUsername: false, cancelEmpty: false}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)
	client := client.Client{HTTPClient: httpClient, ControllerURL: *u}

	err = Delete(&client, "admin")
	// should be a 409 Conflict

	expected := fmt.Errorf("\n%s %s\n\n", "409", "Conflict")
	if reflect.DeepEqual(err, expected) == false {
		t.Errorf("got '%s' but expected '%s'", err, expected)
	}
}
Esempio n. 25
0
func TestKeyCreate(t *testing.T) {
	t.Parallel()

	expected := api.Key{
		Created: "2014-01-01T00:00:00UTC",
		ID:      "*****@*****.**",
		Owner:   "test",
		Public:  "ssh-rsa abc [email protected]",
		Updated: "2014-01-01T00:00:00UTC",
		UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	actual, err := New(&client, "*****@*****.**", "ssh-rsa abc [email protected]")

	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(expected, actual) {
		t.Errorf("Expected %v, Got %v", expected, actual)
	}
}
Esempio n. 26
0
// Register creates a account on a Deis controller.
func Register(controller string, username string, password string, email string,
	sslVerify bool) error {

	u, err := url.Parse(controller)
	httpClient := client.CreateHTTPClient(sslVerify)

	if err != nil {
		return err
	}

	controllerURL, err := chooseScheme(*u)

	if err != nil {
		return err
	}

	if err = client.CheckConnection(httpClient, controllerURL); err != nil {
		return err
	}

	if username == "" {
		fmt.Print("username: "******"" {
		fmt.Print("password: "******"\npassword (confirm): ")
		passwordConfirm, err := readPassword()
		fmt.Println()

		if err != nil {
			return err
		}

		if password != passwordConfirm {
			return errors.New("Password mismatch, aborting registration.")
		}
	}

	if email == "" {
		fmt.Print("email: ")
		fmt.Scanln(&email)
	}

	c := &client.Client{ControllerURL: controllerURL, SSLVerify: sslVerify, HTTPClient: httpClient}

	tempClient, err := client.New()

	if err == nil {
		c.Token = tempClient.Token
	}

	err = auth.Register(c, username, password, email)

	c.Token = ""

	if err != nil {
		fmt.Print("Registration failed: ")
		return err
	}

	fmt.Printf("Registered %s\n", username)
	return doLogin(c, username, password)
}
Esempio n. 27
0
func TestAppsRestart(t *testing.T) {
	t.Parallel()

	tests := []testExpected{
		testExpected{
			Num:  -1,
			Type: "",
			Expected: []api.Process{
				api.Process{
					Owner:   "test",
					App:     "example-go",
					Release: "v2",
					Created: "2014-01-01T00:00:00UTC",
					Updated: "2014-01-01T00:00:00UTC",
					UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
					Type:    "web",
					Num:     1,
					State:   "up",
				},
			},
		},
		testExpected{
			Num:  -1,
			Type: "worker",
			Expected: []api.Process{
				api.Process{
					Owner:   "test",
					App:     "example-go",
					Release: "v2",
					Created: "2014-01-01T00:00:00UTC",
					Updated: "2014-01-01T00:00:00UTC",
					UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
					Type:    "worker",
					Num:     1,
					State:   "up",
				},
			},
		},
		testExpected{
			Num:  2,
			Type: "web",
			Expected: []api.Process{
				api.Process{
					Owner:   "test",
					App:     "example-go",
					Release: "v2",
					Created: "2014-01-01T00:00:00UTC",
					Updated: "2014-01-01T00:00:00UTC",
					UUID:    "de1bf5b5-4a72-4f94-a10c-d2a3741cdf75",
					Type:    "web",
					Num:     2,
					State:   "up",
				},
			},
		},
	}

	handler := fakeHTTPServer{}
	server := httptest.NewServer(&handler)
	defer server.Close()

	u, err := url.Parse(server.URL)

	if err != nil {
		t.Fatal(err)
	}

	httpClient := client.CreateHTTPClient(false)

	client := client.Client{HTTPClient: httpClient, ControllerURL: *u, Token: "abc"}

	for _, test := range tests {
		actual, err := Restart(&client, "example-go", test.Type, test.Num)

		if err != nil {
			t.Error(err)
		}

		if !reflect.DeepEqual(test.Expected, actual) {
			t.Error(fmt.Errorf("Expected %v, Got %v", test.Expected, actual))
		}
	}
}