github.com/wallyworld/juju@v0.0.0-20161013125918-6cf1bc9d917a/worker/toolsversionchecker/export_test.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package toolsversionchecker
     5  
     6  import "github.com/juju/juju/worker"
     7  
     8  func NewPeriodicWorkerForTests(api Facade, params *VersionCheckerParams) worker.Worker {
     9  	w := &toolsVersionWorker{
    10  		api:    api,
    11  		params: params,
    12  	}
    13  	periodicCall := func(stop <-chan struct{}) error {
    14  		return w.doCheck()
    15  	}
    16  	return worker.NewPeriodicWorker(periodicCall, params.CheckInterval, worker.NewTimer)
    17  }