1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 18:05:19 +02:00

[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

@ -47,7 +47,7 @@ func createRepoAndGetContext(t *testing.T, files []string, deleteMdReadme bool)
}
// README.md is already added by auto init
repo, _, f := CreateDeclarativeRepo(t, user, "readmetest", []unit_model.Type{unit_model.TypeCode}, nil, changeFiles)
repo, _, f := tests.CreateDeclarativeRepo(t, user, "readmetest", []unit_model.Type{unit_model.TypeCode}, nil, changeFiles)
ctx, _ := contexttest.MockContext(t, "user1/readmetest")
ctx.SetParams(":id", fmt.Sprint(repo.ID))
@ -158,7 +158,7 @@ func TestRepoView_FindReadme(t *testing.T) {
func TestRepoViewFileLines(t *testing.T) {
onGiteaRun(t, func(t *testing.T, _ *url.URL) {
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
repo, _, f := CreateDeclarativeRepo(t, user, "file-lines", []unit_model.Type{unit_model.TypeCode}, nil, []*files_service.ChangeRepoFile{
repo, _, f := tests.CreateDeclarativeRepo(t, user, "file-lines", []unit_model.Type{unit_model.TypeCode}, nil, []*files_service.ChangeRepoFile{
{
Operation: "create",
TreePath: "test-1",