func (suite *StateSuite) TestGetDNSNamesReturnsNames(c *C) { instances := []instance.Instance{ &dnsNameFakeInstance{name: "foo"}, &dnsNameFakeInstance{name: "bar"}, } c.Check(environs.GetDNSNames(instances), DeepEquals, []string{"foo", "bar"}) }
func (suite *StateSuite) TestGetDNSNamesIgnoresInstancesWithBlankNames(c *C) { instances := []instance.Instance{&dnsNameFakeInstance{name: ""}} c.Check(environs.GetDNSNames(instances), DeepEquals, []string{}) }
func (suite *StateSuite) TestGetDNSNamesIgnoresInstancesWithoutNames(c *C) { instances := []instance.Instance{&dnsNameFakeInstance{err: instance.ErrNoDNSName}} c.Check(environs.GetDNSNames(instances), DeepEquals, []string{}) }
func (suite *StateSuite) TestGetDNSNamesIgnoresNils(c *C) { c.Check(environs.GetDNSNames([]instance.Instance{nil, nil}), DeepEquals, []string{}) }
func (suite *StateSuite) TestGetDNSNamesAcceptsNil(c *C) { result := environs.GetDNSNames(nil) c.Check(result, DeepEquals, []string{}) }