Esempio n. 1
0
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)
}
Esempio n. 2
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. 3
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, jc.ErrorIsNil)
}
Esempio n. 4
0
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)
}
Esempio n. 5
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)
}