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

Function TestFileStorage_Delete

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

Source from the content-addressed store, hash-verified

486}
487
488func TestFileStorage_Delete(t *testing.T) {
489 if !testutils.IsSingleTesting() {
490 return
491 }
492
493 var storage = NewFileStorage(&serverconfigs.HTTPCachePolicy{
494 Id: 1,
495 IsOn: true,
496 Options: map[string]interface{}{
497 "dir": Tea.Root + "/caches",
498 },
499 })
500
501 defer storage.Stop()
502
503 err := storage.Init()
504 if err != nil {
505 t.Fatal(err)
506 }
507 err = storage.Delete("my-key")
508 if err != nil {
509 t.Fatal(err)
510 }
511 t.Log("ok")
512}
513
514func TestFileStorage_Stat(t *testing.T) {
515 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
DeleteMethod · 0.65

Tested by

no test coverage detected