diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-06-15 15:02:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 09:02:00 +0200 |
commit | d91d4db344792760a18265c6902d4ac909d0ee84 (patch) | |
tree | e32232b041671df97164c4398e48316744c32ceb /models/engine_test.go | |
parent | b4d420d8658feced78d897de4fbc9cc6ca76ab4e (diff) | |
download | gitea-d91d4db344792760a18265c6902d4ac909d0ee84.tar.gz gitea-d91d4db344792760a18265c6902d4ac909d0ee84.zip |
Move tests as seperate sub packages to reduce duplicated file names (#19951)
Diffstat (limited to 'models/engine_test.go')
-rw-r--r-- | models/engine_test.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/models/engine_test.go b/models/engine_test.go deleted file mode 100644 index 6f4d114db3..0000000000 --- a/models/engine_test.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2019 The Gitea Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. - -package models - -import ( - "os" - "path/filepath" - "testing" - - "code.gitea.io/gitea/models/db" - "code.gitea.io/gitea/models/unittest" - "code.gitea.io/gitea/modules/setting" - - "github.com/stretchr/testify/assert" -) - -func TestDumpDatabase(t *testing.T) { - assert.NoError(t, unittest.PrepareTestDatabase()) - - dir, err := os.MkdirTemp(os.TempDir(), "dump") - assert.NoError(t, err) - - type Version struct { - ID int64 `xorm:"pk autoincr"` - Version int64 - } - assert.NoError(t, db.GetEngine(db.DefaultContext).Sync2(new(Version))) - - for _, dbType := range setting.SupportedDatabaseTypes { - assert.NoError(t, db.DumpDatabase(filepath.Join(dir, dbType+".sql"), dbType)) - } -} |