func (s *payloadSuite) TestValidateMissingUnit(c *gc.C) { payload := s.newPayload("spam", "docker") payload.Unit = "" err := payload.Validate() c.Check(err, gc.ErrorMatches, `missing Unit .*`) }
func (s *payloadSuite) TestValidateMissingType(c *gc.C) { payload := s.newPayload("spam", "docker") payload.Type = "" err := payload.Validate() c.Check(err, gc.ErrorMatches, `payload class missing type`) }
func (s *payloadSuite) TestValidateUnknownStatus(c *gc.C) { payload := s.newPayload("spam", "docker") payload.Status = "some-unknown-value" err := payload.Validate() c.Check(err, gc.ErrorMatches, `status .* not supported; expected one of .*`) }
func (s *payloadSuite) TestValidateOkay(c *gc.C) { payload := s.newPayload("spam", "docker") err := payload.Validate() c.Check(err, jc.ErrorIsNil) }