(t *testing.T)
| 19 | ) |
| 20 | |
| 21 | func TestFileStorage_Init(t *testing.T) { |
| 22 | if !testutils.IsSingleTesting() { |
| 23 | return |
| 24 | } |
| 25 | |
| 26 | var storage = NewFileStorage(&serverconfigs.HTTPCachePolicy{ |
| 27 | Id: 1, |
| 28 | IsOn: true, |
| 29 | Options: map[string]interface{}{ |
| 30 | "dir": Tea.Root + "/caches", |
| 31 | }, |
| 32 | }) |
| 33 | |
| 34 | defer storage.Stop() |
| 35 | |
| 36 | err := storage.Init() |
| 37 | if err != nil { |
| 38 | t.Fatal(err) |
| 39 | } |
| 40 | //t.Log(storage.list.m) |
| 41 | |
| 42 | /**err = storage.Write("c", bytes.NewReader([]byte("i am c")), 4, "second") |
| 43 | if err != nil { |
| 44 | t.Fatal(err) |
| 45 | }**/ |
| 46 | //logs.PrintAsJSON(storage.list.m, t) |
| 47 | |
| 48 | time.Sleep(2 * time.Second) |
| 49 | storage.purgeLoop() |
| 50 | t.Log(storage.list.(*SQLiteFileList).Stat(func(hash string) bool { |
| 51 | return true |
| 52 | })) |
| 53 | } |
| 54 | |
| 55 | func TestFileStorage_OpenWriter(t *testing.T) { |
| 56 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected