Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-akamai committed Jan 30, 2024
1 parent c488a70 commit 799db49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sshkeys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
},
},
}
Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package metadata
import (
"context"
"errors"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

type TokenMockclient struct {
Expand Down

0 comments on commit 799db49

Please sign in to comment.