(t *testing.T)
| 512 | } |
| 513 | |
| 514 | func TestFileStorage_Stat(t *testing.T) { |
| 515 | if !testutils.IsSingleTesting() { |
| 516 | return |
| 517 | } |
| 518 | |
| 519 | var storage = NewFileStorage(&serverconfigs.HTTPCachePolicy{ |
| 520 | Id: 1, |
| 521 | IsOn: true, |
| 522 | Options: map[string]interface{}{ |
| 523 | "dir": Tea.Root + "/caches", |
| 524 | }, |
| 525 | }) |
| 526 | |
| 527 | defer storage.Stop() |
| 528 | |
| 529 | err := storage.Init() |
| 530 | if err != nil { |
| 531 | t.Fatal(err) |
| 532 | } |
| 533 | |
| 534 | before := time.Now() |
| 535 | defer func() { |
| 536 | t.Log(time.Since(before).Seconds()*1000, "ms") |
| 537 | }() |
| 538 | |
| 539 | stat, err := storage.Stat() |
| 540 | if err != nil { |
| 541 | t.Fatal(err) |
| 542 | } |
| 543 | logs.PrintAsJSON(stat, t) |
| 544 | } |
| 545 | |
| 546 | func TestFileStorage_CleanAll(t *testing.T) { |
| 547 | if !testutils.IsSingleTesting() { |
nothing calls this directly
no test coverage detected