[TESTS] Move CreateDeclarativeRepo to more accessible location

- This allows `CreateDeclarativeRepo` to be used by other testing
packages such as E2EE testing.
- Removes unused function in `services/webhook/sourcehut/builds_test.go`.
This commit is contained in:
Gusted 2024-08-25 02:47:35 +02:00
parent 78e4736db6
commit f78e397dd6
No known key found for this signature in database
GPG key ID: FD821B732837125F
32 changed files with 196 additions and 258 deletions

View file

@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
files_service "code.gitea.io/gitea/services/repository/files"
"code.gitea.io/gitea/tests"
"github.com/PuerkitoBio/goquery"
"github.com/stretchr/testify/assert"
@ -31,7 +32,7 @@ func TestDataSizeTranslation(t *testing.T) {
session := loginUser(t, testUser)
// Create test repo
testRepo, _, f := CreateDeclarativeRepo(t, user2, testRepoName, nil, nil,
testRepo, _, f := tests.CreateDeclarativeRepo(t, user2, testRepoName, nil, nil,
[]*files_service.ChangeRepoFile{
{
Operation: "create",