MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestFileStorage_Stat

Function TestFileStorage_Stat

internal/caches/storage_file_test.go:514–544  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

512}
513
514func 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
546func TestFileStorage_CleanAll(t *testing.T) {
547 if !testutils.IsSingleTesting() {

Callers

nothing calls this directly

Calls 6

IsSingleTestingFunction · 0.92
NewFileStorageFunction · 0.85
LogMethod · 0.80
StopMethod · 0.65
InitMethod · 0.65
StatMethod · 0.65

Tested by

no test coverage detected