MCPcopy Create free account
hub / github.com/gogs/gogs / importTables

Function importTables

internal/database/backup_test.go:220–240  ·  view source on GitHub ↗
(t *testing.T, db *gorm.DB)

Source from the content-addressed store, hash-verified

218}
219
220func importTables(t *testing.T, db *gorm.DB) {
221 ctx := context.Background()
222
223 for _, table := range Tables {
224 tableName := getTableType(table)
225
226 err := func() error {
227 golden := filepath.Join("testdata", "backup", tableName+".golden.json")
228 f, err := os.Open(golden)
229 if err != nil {
230 return errors.Wrap(err, "open table file")
231 }
232 defer func() { _ = f.Close() }()
233
234 return importTable(ctx, db, table, f)
235 }()
236 if err != nil {
237 t.Fatalf("%s: %v", tableName, err)
238 }
239 }
240}

Callers 1

TestDumpAndImportFunction · 0.85

Calls 2

getTableTypeFunction · 0.85
importTableFunction · 0.85

Tested by

no test coverage detected