File: spotmarket_test.go

package info (click to toggle)
golang-github-packethost-packngo 0.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 440 kB
  • sloc: makefile: 2
file content (26 lines) | stat: -rw-r--r-- 533 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
package packngo

import "testing"

func TestAccSpotMarketBasic(t *testing.T) {
	skipUnlessAcceptanceTestsAllowed(t)
	t.Parallel()

	c := setup(t)
	prices, _, err := c.SpotMarket.Prices()
	if err != nil {
		t.Fatal(err)
	}

	dcs := []string{testFacility()}
	for _, dc := range dcs {
		if val, ok := prices[dc]; ok {
			if len(val) == 0 {
				t.Errorf("spot market listing for facility %s doesn't contain any plan prices: %v", dc, val)
			}
		} else {
			t.Errorf("facility %s not in spot prices market map: %v", dc, prices)
		}
	}

}