attachment/store_file_test.go
raw| 1 | package attachment |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | "time" |
| 6 | |
| 7 | "github.com/stretchr/testify/require" |
| 8 | ) |
| 9 | |
| 10 | func newTestFileStore(t *testing.T, totalSizeLimit int64) (dir string, cache *Store) { |
| 11 | t.Helper() |
| 12 | dir = t.TempDir() |
| 13 | cache, err := NewFileStore(dir, totalSizeLimit, time.Hour, nil) |
| 14 | require.Nil(t, err) |
| 15 | t.Cleanup(func() { cache.Close() }) |
| 16 | return dir, cache |
| 17 | } |