MCPcopy Index your code
hub / github.com/FloatTech/AnimeAPI / TestPool

Function TestPool

setu/pool_test.go:12–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestPool(t *testing.T) {
13 p, err := NewPool("pool",
14 func(s string) (string, error) {
15 return "https://pic.moehu.org/large/ec43126fgy1grkj3zrrxsj24dk2k81l1.jpg", nil
16 }, web.GetData, time.Minute)
17 if err != nil {
18 t.Fatal(err)
19 }
20 defer os.RemoveAll("pool")
21 _, err = p.Roll("a")
22 if err == nil {
23 t.Fatal("unexpected success")
24 }
25 err = os.Mkdir("pool/a", 0755)
26 if err != nil {
27 t.Fatal(err)
28 }
29 s, err := p.Roll("a")
30 if err != nil {
31 t.Fatal(err)
32 }
33 assert.Equal(t, "pool/a/燃相縸沌慀.jpeg", s)
34}

Callers

nothing calls this directly

Calls 2

RollMethod · 0.95
NewPoolFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…