Example #1
0
func (suite *StateSuite) TestGetDNSNamesReturnsNames(c *C) {
	instances := []instance.Instance{
		&dnsNameFakeInstance{name: "foo"},
		&dnsNameFakeInstance{name: "bar"},
	}

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