MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / TestFoldersHandleFileEventExcludedPath

Function TestFoldersHandleFileEventExcludedPath

pkg/unpackerr/folder_test.go:159–181  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

157}
158
159func TestFoldersHandleFileEventExcludedPath(t *testing.T) {
160 t.Parallel()
161
162 watchPath := t.TempDir()
163 excluded := filepath.Join(watchPath, "permanent")
164
165 folders := &Folders{
166 Config: []*FolderConfig{{
167 Path: watchPath,
168 ExcludePaths: []string{excluded},
169 }},
170 Events: make(chan *eventData, 1),
171 Logs: noopLogger{},
172 }
173
174 folders.handleFileEvent(filepath.Join(excluded, "file.rar"), "test")
175
176 select {
177 case event := <-folders.Events:
178 t.Fatalf("did not expect event for excluded path: %+v", event)
179 default:
180 }
181}
182
183func newTestFolders(t *testing.T, cfg *FolderConfig) *Folders {
184 t.Helper()

Callers

nothing calls this directly

Calls 1

handleFileEventMethod · 0.95

Tested by

no test coverage detected