func (a mockAPI) Check(term chaosmonkey.Termination, appCfg *chaosmonkey.AppConfig, endHour int, loc *time.Location) (bool, error) {
	return true, nil
}
Check implements api.Checker.Check
package command
import (
	"bytes"
	"io/ioutil"
	"testing"
	"time"
	"github.com/Netflix/chaosmonkey"
	"github.com/Netflix/chaosmonkey/config"
	"github.com/Netflix/chaosmonkey/config/param"
	"github.com/Netflix/chaosmonkey/constrainer"
	"github.com/Netflix/chaosmonkey/mock"
	"github.com/Netflix/chaosmonkey/schedule"
)
func TestScheduleCommand(t *testing.T) {
	cronFile := "/tmp/chaoscron"
	err := EnsureFileAbsent(cronFile)
	if err != nil {
		t.Fatal(err)
	}
	d := mock.Dep()  
	a := new(mockAPI)
	cfg := config.Defaults()
	cfg.Set(param.Enabled, true)
	cfg.Set(param.CronPath, cronFile)
	cfg.Set(param.Accounts, []string{"prod", "test"})
	appNames, err := d.AppNames()
	if err != nil {
		t.Fatalf("%v", err)
	}
	err = do(d, a, a, cfg, constrainer.NullConstrainer{}, appNames)
	if err != nil {
		t.Errorf("%v", err)
	}
	expectedCount := 4
	cronFileContents, err := ioutil.ReadFile(cronFile)
	if err != nil {
		t.Fatal(err)
	}
	actualCount := countEntries(cronFileContents)
	if actualCount != expectedCount {
		t.Errorf("\nExpected:\n%d\nActual:\n%d", expectedCount, actualCount)
	}
}
func countEntries(buf []byte) int {
	return bytes.Count(buf, []byte("\n"))
}
type mockAPI struct {
}
func (a mockAPI) Publish(date time.Time, sched *schedule.Schedule) error {
	return nil
}
func (a mockAPI) Retrieve(date time.Time) (*schedule.Schedule, error) {
	return nil, nil
}
func (a mockAPI) Get(name string) (*chaosmonkey.AppConfig, error) {
	cfg := chaosmonkey.NewAppConfig(nil)
	cfg.MeanTimeBetweenKillsInWorkDays = 1
	return &cfg, nil
}