mirror of
https://github.com/go-gitea/gitea
synced 2025-07-05 18:17:19 +00:00
Allow get release download files and lfs files with oauth2 token format (#26430)
Fix #26165 Fix #25257
This commit is contained in:
@ -179,6 +179,20 @@ func InitTest(requireGitea bool) {
|
||||
routers.InitWebInstalled(graceful.GetManager().HammerContext())
|
||||
}
|
||||
|
||||
func PrepareAttachmentsStorage(t testing.TB) {
|
||||
// prepare attachments directory and files
|
||||
assert.NoError(t, storage.Clean(storage.Attachments))
|
||||
|
||||
s, err := storage.NewStorage(setting.LocalStorageType, &setting.Storage{
|
||||
Path: filepath.Join(filepath.Dir(setting.AppPath), "tests", "testdata", "data", "attachments"),
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, s.IterateObjects("", func(p string, obj storage.Object) error {
|
||||
_, err = storage.Copy(storage.Attachments, p, s, p)
|
||||
return err
|
||||
}))
|
||||
}
|
||||
|
||||
func PrepareTestEnv(t testing.TB, skip ...int) func() {
|
||||
t.Helper()
|
||||
ourSkip := 1
|
||||
|
Reference in New Issue
Block a user