You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: client_public_test.go
    path of file: ./repos/shellhub/pkg/api/client
    
    the code of the file until where you have to start completion: package client

import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"net/http"
	"testing"

	mock "github.com/jarcoal/httpmock"
	reversermock "github.com/shellhub-io/shellhub/pkg/api/client/mocks"
	"github.com/shellhub-io/shellhub/pkg/models"
	"github.com/shellhub-io/shellhub/pkg/revdial"
	"github.com/stretchr/testify/assert"
)

func TestGetInfo(t *testing.T) {
	type Expected struct {
		info *models.Info
		err  error
	}

	tests := []struct {
		description   string
		version       string
		requiredMocks func()
		expected      Expected
	}{
		{
			description: "success to get info",
			version:     "v0.13.0",
			requiredMocks: func() {
				responder, _ := mock.NewJsonResponder(200, models.Info{
					Version: "v0.13.0",
					Endpoints: models.Endpoints{
						API: "cloud.shellhub.io:443",
						SSH: "cloud.shellhub.io:2222",
					},
				})

				mock.RegisterResponder("GET", "/info?agent_version=v0.13.0", responder)
			},
			expected: Expected{
				info: &models.Info{
					Version: "v0.13.0",
					Endpoints: models.Endpoints{
						API: "cloud.shellhub.io:443",
						SSH: "cloud.shellhub.io:2222",
					},
				},
				err: nil,
			},
		},
		{
			description: "success to get info after retry",
			version:     "v0.13.0",
			requiredMocks: func() {
				fail := mock.NewErrorResponder(errors.New("error on request"))
				success, _ := mock.NewJsonResponder(200, models.Info{
					Version: "v0.13.0",
					Endpoints: models.Endpoints{
						API: "cloud.shellhub.io:443",
						SSH: "cloud.shellhub.io:2222",
					},
				})

				responder := fail.
					Then(fail).
					Then(fail).
					Then(success)

				mock.RegisterResponder("GET", "/info?agent_version=v0.13.0", responder)
			},
			expected: Expected{
				info: &
    
func TestAuthDevice(t *testing.T) {
	type Expected struct {
		response *models.DeviceAuthResponse
		err      error
	}

	tests := []struct {
		description   string
		request       *models.DeviceAuthRequest
		requiredMocks func()
		expected      Expected
	}{
		{
			description: "success to auth device",
			request: &models.DeviceAuthRequest{
				Info: &models.DeviceInfo{
					ID:         "manjaro",
					PrettyName: "Manjaro",
					Version:    "latest",
					Arch:       "amd64",
					Platform:   "docker",
				},
				DeviceAuth: &models.DeviceAuth{
					Hostname: "83-18-77-25-78-0d",
					Identity: &models.DeviceIdentity{
						MAC: "83:18:77:25:78:0d",
					},
					TenantID:  "00000000-0000-4000-0000-000000000000",
					PublicKey: "",
				},
			},
			requiredMocks: func() {
				responder, _ := mock.NewJsonResponder(200, models.DeviceAuthResponse{
					UID:       "3a471bd84c88b28c4e4f8e27caee40e7b14798325e6dd85aa62d54e27fd11117",
					Token:     "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
					Name:      "83-18-77-25-78-0d",
					Namespace: "00000000-0000-4000-0000-000000000000",
				})

				mock.RegisterResponder("POST", "/api/devices/auth", responder)
			},
			expected: Expected{
				response: &models.DeviceAuthResponse{
					UID:       "3a471bd84c88b28c4e4f8e27caee40e7b14798325e6dd85aa62d54e27fd11117",
					Token:     "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
					Name:      "83-18-77-25-78-0d",
					Namespace: "00000000-0000-4000-0000-000000000000",
				},
				err: nil,
			},
		},
		{
			description: "success to auth after any error",
			request: &models.DeviceAuthRequest{
				Info: &models.DeviceInfo{
					ID:         "manjaro",
					PrettyName: "Manjaro",
					Version:    "latest",
					Arch:       "amd64",
					Platform:   "docker",
				},
				DeviceAuth: &models.DeviceAuth{
					Hostname: "83-18-77-25-78-0d",
					Identity: &models.DeviceIdentity{
						MAC: "83:18:77:25:78:0d",
					},
					TenantID:  "00000000-0000-4000-0000-000000000000",
					PublicKey: "",
				},
			},
			requiredMocks: func() {
				fail, _ := mock.NewJsonResponder(404, nil)
				success, _ := mock.NewJsonResponder(200, models.DeviceAuthResponse{
					UID:       "3a471bd84c88b28c4e4f8e27caee40e7b14798325e6dd85aa62d54e27fd11117",
					Token:     "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
					Name:      "83-18-77-25-78-0d",
					Namespace: "00000000-0000-4000-0000-000000000000",
				})

				responder := fail.
					Then(fail).
					Then(fail).Then(success)

				mock.RegisterResponder("POST", "/api/devices/auth", responder)
			},
			expected: Expected{
				response: &models.DeviceAuthResponse{
					UID:       "3a471bd84c88b28c4e4f8e27caee40e7b14798325e6dd85aa62d54e27fd11117",
					Token:     "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
					Name:      "83-18-77-25-78-0d",
					Namespace: "00000000-0000-4000-0000-000000000000",
				},
				err: nil,
			},
		},
	}

	for _, test := range tests {
		t.Run(test.description, func(t *testing.T) {
			cli, err := NewClient("https://www.cloud.shellhub.io/")
			assert.NoError(t, err)

			client, ok := cli.(*client)
			assert.True(t, ok)

			mock.ActivateNonDefault(client.http.GetClient())
			defer mock.DeactivateAndReset()

			test.requiredMocks()

			response, err := cli.AuthDevice(test.request)
			assert.Equal(t, test.expected, Expected{response, err})
		})
	}
}