本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
652B

  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import (
  6. "io/ioutil"
  7. "os"
  8. "path/filepath"
  9. "testing"
  10. "code.gitea.io/gitea/modules/setting"
  11. "github.com/stretchr/testify/assert"
  12. )
  13. func TestDumpDatabase(t *testing.T) {
  14. assert.NoError(t, PrepareTestDatabase())
  15. dir, err := ioutil.TempDir(os.TempDir(), "dump")
  16. assert.NoError(t, err)
  17. for _, dbName := range setting.SupportedDatabases {
  18. dbType := setting.GetDBTypeByName(dbName)
  19. assert.NoError(t, DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType))
  20. }
  21. }
上海开阖软件有限公司 沪ICP备12045867号-1