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/user/openid_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/user/openid_test.go')
-rw-r--r-- | models/user/openid_test.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/models/user/openid_test.go b/models/user/openid_test.go index ba678ef864..d20b72d19a 100644 --- a/models/user/openid_test.go +++ b/models/user/openid_test.go @@ -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 user +package user_test import ( "testing" "code.gitea.io/gitea/models/unittest" + user_model "code.gitea.io/gitea/models/user" "github.com/stretchr/testify/assert" ) @@ -15,7 +16,7 @@ import ( func TestGetUserOpenIDs(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - oids, err := GetUserOpenIDs(int64(1)) + oids, err := user_model.GetUserOpenIDs(int64(1)) if assert.NoError(t, err) && assert.Len(t, oids, 2) { assert.Equal(t, "https://user1.domain1.tld/", oids[0].URI) assert.False(t, oids[0].Show) @@ -23,7 +24,7 @@ func TestGetUserOpenIDs(t *testing.T) { assert.True(t, oids[1].Show) } - oids, err = GetUserOpenIDs(int64(2)) + oids, err = user_model.GetUserOpenIDs(int64(2)) if assert.NoError(t, err) && assert.Len(t, oids, 1) { assert.Equal(t, "https://domain1.tld/user2/", oids[0].URI) assert.True(t, oids[0].Show) @@ -32,28 +33,28 @@ func TestGetUserOpenIDs(t *testing.T) { func TestToggleUserOpenIDVisibility(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) - oids, err := GetUserOpenIDs(int64(2)) + oids, err := user_model.GetUserOpenIDs(int64(2)) if !assert.NoError(t, err) || !assert.Len(t, oids, 1) { return } assert.True(t, oids[0].Show) - err = ToggleUserOpenIDVisibility(oids[0].ID) + err = user_model.ToggleUserOpenIDVisibility(oids[0].ID) if !assert.NoError(t, err) { return } - oids, err = GetUserOpenIDs(int64(2)) + oids, err = user_model.GetUserOpenIDs(int64(2)) if !assert.NoError(t, err) || !assert.Len(t, oids, 1) { return } assert.False(t, oids[0].Show) - err = ToggleUserOpenIDVisibility(oids[0].ID) + err = user_model.ToggleUserOpenIDVisibility(oids[0].ID) if !assert.NoError(t, err) { return } - oids, err = GetUserOpenIDs(int64(2)) + oids, err = user_model.GetUserOpenIDs(int64(2)) if !assert.NoError(t, err) { return } |