Esempio n. 1
0
func (s *EnvironCapabilitySuite) TestSupportsUnitPlacementNoPolicy(c *gc.C) {
	s.policy.getEnvironCapability = func(*config.Config) (state.EnvironCapability, error) {
		c.Errorf("should not have been invoked")
		return nil, nil
	}
	state.SetPolicy(s.State, nil)
	_, err := s.addOneMachine(c)
	c.Assert(err, gc.IsNil)
}
Esempio n. 2
0
func (s *ConfigValidatorSuite) TestConfigValidateNoPolicy(c *gc.C) {
	s.policy.getConfigValidator = func(providerType string) (state.ConfigValidator, error) {
		c.Errorf("should not have been invoked")
		return nil, nil
	}

	state.SetPolicy(s.State, nil)
	err := s.updateEnvironConfig(c)
	c.Assert(err, gc.IsNil)
}
Esempio n. 3
0
func (s *InstanceDistributorSuite) TestDistributeInstancesNoPolicy(c *gc.C) {
	s.policy.getInstanceDistributor = func(*config.Config) (state.InstanceDistributor, error) {
		c.Errorf("should not have been invoked")
		return nil, nil
	}
	state.SetPolicy(s.State, nil)
	unit, err := s.wordpress.AddUnit()
	c.Assert(err, gc.IsNil)
	_, err = unit.AssignToCleanMachine()
	c.Assert(err, gc.IsNil)
}