From c488a70dd396a52f85d79d2d146b0e81ae741d01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 03:20:19 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/linode/linodego in /test/integration Bumps [github.com/linode/linodego](https://github.com/linode/linodego) from 1.27.1 to 1.28.0. - [Release notes](https://github.com/linode/linodego/releases) - [Commits](https://github.com/linode/linodego/compare/v1.27.1...v1.28.0) --- updated-dependencies: - dependency-name: github.com/linode/linodego dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- test/integration/go.mod | 2 +- test/integration/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/go.mod b/test/integration/go.mod index f36e05e..4531218 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -8,7 +8,7 @@ go 1.20 require ( github.com/jarcoal/httpmock v1.3.1 github.com/linode/go-metadata v0.0.0 - github.com/linode/linodego v1.27.1 + github.com/linode/linodego v1.28.0 github.com/stretchr/testify v1.8.4 ) diff --git a/test/integration/go.sum b/test/integration/go.sum index df6fbac..873ba1b 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -5,8 +5,8 @@ github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5 github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww= github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= -github.com/linode/linodego v1.27.1 h1:KoQm5g2fppw8qIClJqUEL0yKH0+f+7te3Mewagb5QKE= -github.com/linode/linodego v1.27.1/go.mod h1:5oAsx+uinHtVo6U77nXXXtox7MWzUW6aEkTOKXxA9uo= +github.com/linode/linodego v1.28.0 h1:lzxxJebsYg5cCWRNDLyL2StW3sfMyAwf/FYfxFjFrlk= +github.com/linode/linodego v1.28.0/go.mod h1:5oAsx+uinHtVo6U77nXXXtox7MWzUW6aEkTOKXxA9uo= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= From 799db49e252ff65ee9f44d7b51e02746aa7350de Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Mon, 29 Jan 2024 19:47:46 -0500 Subject: [PATCH 2/2] Fix test --- sshkeys_test.go | 6 +++--- token_test.go | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sshkeys_test.go b/sshkeys_test.go index 8a9d918..b15430a 100644 --- a/sshkeys_test.go +++ b/sshkeys_test.go @@ -24,8 +24,8 @@ func TestGetSSHKeys_Success(t *testing.T) { // Create a mock client with a successful response mockClient := &SshkeysMockclient{ Resp: &SSHKeysData{ - Users: SSHKeysUserData{ - Root: []string{"ssh-randomkeyforunittestas;ldkjfqweeru", "ssh-randomkeyforunittestas;ldkjfqweerutwo"}, + Users: map[string][]string{ + "Root": {"ssh-randomkeyforunittestas;ldkjfqweeru", "ssh-randomkeyforunittestas;ldkjfqweerutwo"}, }, }, } @@ -34,7 +34,7 @@ func TestGetSSHKeys_Success(t *testing.T) { assert.NoError(t, err, "Expected no error") assert.NotNil(t, sshKeys, "Expected non-nil SSHKeysData") - assert.Len(t, sshKeys.Users.Root, 2, "Unexpected number of root SSH keys") + assert.Len(t, sshKeys.Users["Root"], 2, "Unexpected number of root SSH keys") } func TestGetSSHKeys_Error(t *testing.T) { diff --git a/token_test.go b/token_test.go index 9328a03..daa1fd8 100644 --- a/token_test.go +++ b/token_test.go @@ -3,8 +3,9 @@ package metadata import ( "context" "errors" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) type TokenMockclient struct {