예제 #1
0
파일: spaces_test.go 프로젝트: imoapps/juju
func assertSpace(c *gc.C, space *state.Space, name string, subnets []string, isPublic bool) {
	c.Assert(space.Name(), gc.Equals, name)
	actualSubnets, err := space.Subnets()
	c.Assert(err, jc.ErrorIsNil)
	actualSubnetIds := make([]string, len(actualSubnets))
	for i, subnet := range actualSubnets {
		actualSubnetIds[i] = subnet.CIDR()
	}
	c.Assert(actualSubnetIds, jc.SameContents, subnets)
	c.Assert(state.SpaceDoc(space).IsPublic, gc.Equals, isPublic)

	c.Assert(space.Life(), gc.Equals, state.Alive)
	c.Assert(strings.HasSuffix(space.ID(), name), jc.IsTrue)
	c.Assert(space.String(), gc.Equals, name)
}
예제 #2
0
파일: spaces_test.go 프로젝트: bac/juju
func (s *SpacesSuite) assertSpaceMatchesArgs(c *gc.C, space *state.Space, args addSpaceArgs) {
	c.Assert(space.Name(), gc.Equals, args.Name)
	c.Assert(space.ProviderId(), gc.Equals, args.ProviderId)

	actualSubnets, err := space.Subnets()
	c.Assert(err, jc.ErrorIsNil)
	actualSubnetIds := make([]string, len(actualSubnets))
	for i, subnet := range actualSubnets {
		actualSubnetIds[i] = subnet.CIDR()
	}
	c.Assert(actualSubnetIds, jc.SameContents, args.SubnetCIDRs)
	c.Assert(state.SpaceDoc(space).IsPublic, gc.Equals, args.IsPublic)

	c.Assert(space.Life(), gc.Equals, state.Alive)
	c.Assert(space.String(), gc.Equals, args.Name)
}