MCPcopy
hub / github.com/pocketbase/pocketbase / TestBaseAppNewBackupsFilesystem

Function TestBaseAppNewBackupsFilesystem

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

Source from the content-addressed store, hash-verified

237}
238
239func TestBaseAppNewBackupsFilesystem(t *testing.T) {
240 const testDataDir = "./pb_base_app_test_data_dir/"
241 defer os.RemoveAll(testDataDir)
242
243 app := core.NewBaseApp(core.BaseAppConfig{
244 DataDir: testDataDir,
245 })
246 defer app.ResetBootstrapState()
247
248 // local
249 local, localErr := app.NewBackupsFilesystem()
250 if localErr != nil {
251 t.Fatal(localErr)
252 }
253 if local == nil {
254 t.Fatal("Expected local backups filesystem instance, got nil")
255 }
256
257 // misconfigured s3
258 app.Settings().Backups.S3.Enabled = true
259 s3, s3Err := app.NewBackupsFilesystem()
260 if s3Err == nil {
261 t.Fatal("Expected S3 error, got nil")
262 }
263 if s3 != nil {
264 t.Fatalf("Expected nil s3 backups filesystem, got %v", s3)
265 }
266}
267
268func TestBaseAppLoggerWrites(t *testing.T) {
269 t.Parallel()

Callers

nothing calls this directly

Calls 5

ResetBootstrapStateMethod · 0.95
NewBackupsFilesystemMethod · 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…