示例#1
0
func (s *ValidateSuite) checkNotValid(c *gc.C, match string) {
	check := func(err error) {
		c.Check(err, jc.Satisfies, errors.IsNotValid)
		c.Check(err, gc.ErrorMatches, match)
	}
	err := s.config.Validate()
	check(err)

	worker, err := charmrevision.NewWorker(s.config)
	c.Check(worker, gc.IsNil)
	check(err)
}
示例#2
0
func (fix workerFixture) runTest(c *gc.C, test testFunc, checkWaitErr bool) {
	w, err := charmrevision.NewWorker(charmrevision.Config{
		RevisionUpdater: fix.revisionUpdater,
		Clock:           fix.clock,
		Period:          fix.period,
	})
	c.Assert(err, jc.ErrorIsNil)
	defer func() {
		err := worker.Stop(w)
		if checkWaitErr {
			c.Check(err, jc.ErrorIsNil)
		}
	}()
	test(w)
}