예제 #1
0
func injectDependencies() {
	uploader := upload.NewAmazonS3Upload(s3accesskey, s3secretkey, s3bucketname)
	core.InjectUploader(uploader)

	store := storage.NewJobStore()
	core.InjectJobstore(&store)
	core.InjectStorageReporter(&store)
}
예제 #2
0
func TestAllWithSetup(t *testing.T) {
	go StartWebServer(portnum)
	time.Sleep(50 * time.Millisecond)
	mock = upload.NewMock()
	core.InjectUploader(mock)
	store := storage.NewJobStore()
	core.InjectJobstore(&store)
	core.InjectStorageReporter(&store)
	err := MakeGrayFile(1000, 1000, "/tmp/upload.gif")
	if err != nil {
		t.Error("Error in creating test file")
	}
	defer os.Remove("/tmp/upload.gif")

	testStartWebserver(t)
	testStatusOfBadJob(t)
	testRequestingNewJob(t)
	testStatusOfExistingJob(t)
	testStatsReturnsJSON(t)
}