MCPcopy Create free account
hub / github.com/FloatTech/AnimeAPI / TestDownloadToCache

Function TestDownloadToCache

pixiv/download_test.go:12–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestDownloadToCache(t *testing.T) {
13 illust, err := Works(96415148)
14 if err != nil {
15 t.Fatal(err)
16 }
17 err = illust.DownloadToCache(0)
18 if err != nil {
19 t.Fatal(err)
20 }
21 data, err := os.ReadFile(illust.Path(0))
22 if err != nil {
23 t.Fatal(err)
24 }
25 m := md5.Sum(data)
26 ms := hex.EncodeToString(m[:])
27 assert.Equal(t, "bc635c27d278c414ca8347487d005b6d", ms)
28}

Callers

nothing calls this directly

Calls 3

WorksFunction · 0.85
DownloadToCacheMethod · 0.80
PathMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…