Move some files into models' sub packages (#20262)

* Move some files into models' sub packages

* Move functions

* merge main branch

* Fix check

* fix check

* Fix some tests

* Fix lint

* Fix lint

* Revert lint changes

* Fix error comments

* Fix lint

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Lunny Xiao 2022-08-25 10:31:57 +08:00 committed by GitHub
parent 4a4bfafa23
commit 1d8543e7db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
154 changed files with 1763 additions and 1738 deletions

View file

@ -2,12 +2,13 @@
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package auth
package auth_test
import (
"strings"
"testing"
auth_model "code.gitea.io/gitea/models/auth"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/json"
@ -37,13 +38,13 @@ func (source *TestSource) ToDB() ([]byte, error) {
func TestDumpAuthSource(t *testing.T) {
assert.NoError(t, unittest.PrepareTestDatabase())
authSourceSchema, err := db.TableInfo(new(Source))
authSourceSchema, err := db.TableInfo(new(auth_model.Source))
assert.NoError(t, err)
RegisterTypeConfig(OAuth2, new(TestSource))
auth_model.RegisterTypeConfig(auth_model.OAuth2, new(TestSource))
CreateSource(&Source{
Type: OAuth2,
auth_model.CreateSource(&auth_model.Source{
Type: auth_model.OAuth2,
Name: "TestSource",
IsActive: false,
Cfg: &TestSource{