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

Function TestFS_RemoveFile

internal/utils/bfs/fs_test.go:104–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestFS_RemoveFile(t *testing.T) {
105 fs, openErr := bfs.OpenFS(Tea.Root+"/data/bfs/test", bfs.DefaultFSOptions)
106 if openErr != nil {
107 t.Fatal(openErr)
108 }
109 defer func() {
110 _ = fs.Close()
111 }()
112
113 var hash = bfs.Hash("123456")
114 err := fs.RemoveFile(hash)
115 if err != nil {
116 t.Fatal(err)
117 }
118
119 exist, err := fs.ExistFile(bfs.Hash("123456"))
120 if err != nil {
121 t.Fatal(err)
122 }
123 t.Log("exist:", exist)
124}
125
126func TestFS_OpenFileWriter_Close(t *testing.T) {
127 if !testutils.IsSingleTesting() {

Callers

nothing calls this directly

Calls 6

OpenFSFunction · 0.92
HashFunction · 0.92
LogMethod · 0.80
CloseMethod · 0.65
RemoveFileMethod · 0.45
ExistFileMethod · 0.45

Tested by

no test coverage detected