MCPcopy
hub / github.com/perkeep/perkeep / handlerDescribeTestSetupWithImage

Function handlerDescribeTestSetupWithImage

pkg/search/handler_test.go:235–252  ·  view source on GitHub ↗

extends handlerDescribeTestSetup but adds a camliContentImage to pn. lastModtime is at test.ClockOrigin + 9s on return.

(t *testing.T)

Source from the content-addressed store, hash-verified

233// extends handlerDescribeTestSetup but adds a camliContentImage to pn.
234// lastModtime is at test.ClockOrigin + 9s on return.
235func handlerDescribeTestSetupWithImage(t *testing.T) indexAndOwner {
236 ixo := handlerDescribeTestSetup(t)
237 idx := ixo.index
238 tf := idx.KeyFetcher.(*test.Fetcher)
239 fi := &fetcherIndex{
240 tf: tf,
241 idx: idx,
242 }
243 perma123 := testBlobs["perma-123"]
244 imageBlob := testBlobs["fakeref-789"]
245 checkErr(t, fi.addBlob(imageBlob))
246 lastModtime = test.ClockOrigin.Add(8 * time.Second).UTC()
247 checkErr(t, fi.addClaim(schema.NewSetAttributeClaim(perma123.BlobRef(), "camliContentImage", imageBlob.BlobRef().String())))
248 return indexAndOwner{
249 index: idx,
250 owner: owner.BlobRef(),
251 }
252}
253
254// extends handlerDescribeTestSetup but adds various embedded references to other nodes.
255// lastModtime is at test.ClockOrigin + 14s on return.

Callers

nothing calls this directly

Calls 8

addBlobMethod · 0.95
addClaimMethod · 0.95
NewSetAttributeClaimFunction · 0.92
handlerDescribeTestSetupFunction · 0.85
checkErrFunction · 0.85
BlobRefMethod · 0.65
AddMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected