func (s *PrecheckerSuite) TestPrecheckNoPolicy(c *gc.C) { s.policy.GetPrechecker = func(*config.Config) (state.Prechecker, error) { c.Errorf("should not have been invoked") return nil, nil } state.SetPolicy(s.State, nil) _, err := s.addOneMachine(c, constraints.Value{}, "placement") c.Assert(err, jc.ErrorIsNil) }
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) }
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, jc.ErrorIsNil) }
func (s *ConfigValidatorSuite) TestConfigValidateNoPolicy(c *gc.C) { s.policy.GetConfigValidator = func() (config.Validator, error) { c.Errorf("should not have been invoked") return nil, nil } state.SetPolicy(s.State, nil) err := s.updateModelConfig(c) c.Assert(err, jc.ErrorIsNil) }
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) }