File: network_pools_test.go

package info (click to toggle)
golang-github-linode-linodego 1.55.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,112 kB
  • sloc: makefile: 96; sh: 52; python: 24
file content (31 lines) | stat: -rw-r--r-- 991 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"

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

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

	ipv6Pools, err := client.ListIPv6Pools(context.Background(), nil)
	require.NoError(t, err, "Error getting IPv6 Pools, expected struct")

	require.NotEmpty(t, ipv6Pools, "Expected to see IPv6 pools returned")

	require.Equal(t, "1234::5678/32", ipv6Pools[0].Range, "Expected IPv6 pool range '1234::5678/32'")
}

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

	ipv6Pool, err := client.GetIPv6Pool(context.Background(), "1234::5678/32")
	require.NoError(t, err, "Error getting IPv6 Pool, expected struct")

	require.Equal(t, "1234::5678/32", ipv6Pool.Range, "Expected IPv6 pool range '1234::5678/32'")
	require.Equal(t, "us-east", ipv6Pool.Region, "Expected IPv6 pool region 'us-east'")
}