mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-11 04:11:18 +01:00
tests: Add an IsTemplate option to DeclarativeRepoOptions
This lets us use `CreateDeclarativeRepoWithOptions` to create template repositories. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
e1fe3bbdc0
commit
a414703c09
1 changed files with 2 additions and 0 deletions
|
@ -701,6 +701,7 @@ type DeclarativeRepoOptions struct {
|
||||||
Files optional.Option[[]*files_service.ChangeRepoFile]
|
Files optional.Option[[]*files_service.ChangeRepoFile]
|
||||||
WikiBranch optional.Option[string]
|
WikiBranch optional.Option[string]
|
||||||
AutoInit optional.Option[bool]
|
AutoInit optional.Option[bool]
|
||||||
|
IsTemplate optional.Option[bool]
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateDeclarativeRepoWithOptions(t *testing.T, owner *user_model.User, opts DeclarativeRepoOptions) (*repo_model.Repository, string, func()) {
|
func CreateDeclarativeRepoWithOptions(t *testing.T, owner *user_model.User, opts DeclarativeRepoOptions) (*repo_model.Repository, string, func()) {
|
||||||
|
@ -731,6 +732,7 @@ func CreateDeclarativeRepoWithOptions(t *testing.T, owner *user_model.User, opts
|
||||||
License: "WTFPL",
|
License: "WTFPL",
|
||||||
Readme: "Default",
|
Readme: "Default",
|
||||||
DefaultBranch: "main",
|
DefaultBranch: "main",
|
||||||
|
IsTemplate: opts.IsTemplate.Value(),
|
||||||
})
|
})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.NotEmpty(t, repo)
|
assert.NotEmpty(t, repo)
|
||||||
|
|
Loading…
Reference in a new issue