Beispiel #1
0
// test Create / POST functionality
func creates(edImageBatch, crVideoBatch espsdk.Batch) {
	makeBomb("create_batch", "POST", espsdk.BatchesEndpoint, espsdk.Batch{
		SubmissionName:        appID + ": " + fake.FullName(),
		SubmissionType:        "getty_editorial_still",
		SaveExtractedMetadata: false,
	})

	edImage := espsdk.Contribution{
		// reference time: Mon Jan 2 15:04:05 -0700 MST 2006
		CameraShotDate:       time.Now().Format("01/02/2006 15:04:05 -0700"),
		ContentProviderName:  "SHERER, John",
		ContentProviderTitle: "Contributor",
		CountryOfShoot:       "United Kingdom",
		CreditLine:           "John Sherer",
		ExternalFileLocation: "https://c2.staticflickr.com/4/3747/11235643633_60b8701616_o.jpg",
		FileName:             "11235643633_60b8701616_o.jpg",
		Headline:             fake.Sentence(),
		IPTCCategory:         "S",
		SiteDestination:      []string{"Editorial", "WireImage.com"},
		Source:               "AFP",
		SubmissionBatchID:    edImageBatch.ID,
	}
	makeBomb("create_photo", "POST", edImage.Path(), edImage)
	makeMissile("create_and_submit_photo", edImage.CreateAndSubmit)

	release := espsdk.Release{
		FileName:          "some_property.jpg",
		FilePath:          "submission/releases/batch_86572/24780225369200015_some_property.jpg",
		MimeType:          "image/jpeg",
		ReleaseType:       "Property",
		SubmissionBatchID: crVideoBatch.ID,
	}
	makeBomb("create_release", "POST", release.Path(), release)
}
Beispiel #2
0
// a few objects that don't exist, to test 404
func duds(edImageBatch, crVideoBatch espsdk.Batch) {
	badBatch := espsdk.Batch{ID: "-1"}
	badContribution := espsdk.Contribution{ID: "-1", SubmissionBatchID: edImageBatch.ID}
	badRelease := espsdk.Release{ID: "-1", SubmissionBatchID: crVideoBatch.ID}
	makeBomb("get_invalid_batch", "GET", badBatch.Path(), badBatch)
	makeBomb("get_invalid_contribution", "GET", badContribution.Path(), badContribution)
	makeBomb("get_invalid_release", "GET", badRelease.Path(), badRelease)
}