File: profile_logins_test.go

package info (click to toggle)
golang-github-linode-linodego 1.47.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,032 kB
  • sloc: makefile: 95; sh: 52; python: 24
file content (31 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package integration

import (
	"context"
	"testing"
)

func TestProfileLogins_List(t *testing.T) {
	client, teardown := createTestClient(t, "fixtures/TestProfileLogins_List")
	defer teardown()

	logins, err := client.ListProfileLogins(context.Background(), nil)
	if err != nil {
		t.Errorf("Error getting Profile Logins, expected struct, got error %v", err)
	}

	if len(logins) < 1 {
		t.Errorf("Expected to see at least one Profile Login")
	}

	login := logins[0]

	response, err := client.GetProfileLogin(context.Background(), login.ID)
	if err != nil {
		t.Errorf("Failed to get one Profile Login: %v", err)
	}

	if response.Username != login.Username {
		t.Fatal("Recieved Profile Login Username does not match source")
	}
}