MCPcopy
hub / github.com/pocketbase/pocketbase / TestBaseAppNewFilesystem

Function TestBaseAppNewFilesystem

core/base_test.go:210–237  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

208}
209
210func TestBaseAppNewFilesystem(t *testing.T) {
211 const testDataDir = "./pb_base_app_test_data_dir/"
212 defer os.RemoveAll(testDataDir)
213
214 app := core.NewBaseApp(core.BaseAppConfig{
215 DataDir: testDataDir,
216 })
217 defer app.ResetBootstrapState()
218
219 // local
220 local, localErr := app.NewFilesystem()
221 if localErr != nil {
222 t.Fatal(localErr)
223 }
224 if local == nil {
225 t.Fatal("Expected local filesystem instance, got nil")
226 }
227
228 // misconfigured s3
229 app.Settings().S3.Enabled = true
230 s3, s3Err := app.NewFilesystem()
231 if s3Err == nil {
232 t.Fatal("Expected S3 error, got nil")
233 }
234 if s3 != nil {
235 t.Fatalf("Expected nil s3 filesystem, got %v", s3)
236 }
237}
238
239func TestBaseAppNewBackupsFilesystem(t *testing.T) {
240 const testDataDir = "./pb_base_app_test_data_dir/"

Callers

nothing calls this directly

Calls 5

ResetBootstrapStateMethod · 0.95
NewFilesystemMethod · 0.95
SettingsMethod · 0.95
NewBaseAppFunction · 0.92
RemoveAllMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…