func TestAvailDistributionsIntegration(t *testing.T) { c := NewClient(apiKey) dists, err := c.AvailDistributions(nil) require.NoError(t, err) require.NotEmpty(t, dists) testDistsNotEmpty(t, dists) dists, err = c.AvailDistributions(Int(130)) assert.NoError(t, err) assert.Len(t, dists, 1) d := dists[0] assert.Equal(t, true, d.RequiresPVOps, "d.RequiresPVOps") assert.Equal(t, 130, d.ID, "d.ID") assert.Equal(t, true, d.Is64Bit, "d.Is64Bit") assert.Equal(t, "Debian 7", d.Label, "d.Label") assert.Equal(t, 600, d.MinImageSize, "d.MinImageSize") assert.Equal(t, "2014-09-24 13:59:32.0", d.CreateDT, "d.CreateDT") dists, err = c.AvailDistributions(Int(38201938)) assert.NoError(t, err) assert.Empty(t, dists) }
func TestAvailDistributionsOK(t *testing.T) { c, ts := clientFor(newMockAPIServer(t, mockAvailDistributionsOK())) defer ts.Close() dists, err := c.AvailDistributions(nil) require.NoError(t, err) require.NotEmpty(t, dists) assert.Len(t, dists, 22) }