mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 12:07:20 +00:00
* Test if object is accessible. * Added more logging. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
@ -254,6 +254,10 @@ func TestAPILFSBatch(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, exist)
|
||||
|
||||
repo2 := createLFSTestRepository(t, "batch2")
|
||||
content := []byte("dummy0")
|
||||
storeObjectInRepo(t, repo2.ID, &content)
|
||||
|
||||
meta, err := repo.GetLFSMetaObjectByOid(p.Oid)
|
||||
assert.Nil(t, meta)
|
||||
assert.Equal(t, models.ErrLFSObjectNotExist, err)
|
||||
@ -359,13 +363,19 @@ func TestAPILFSUpload(t *testing.T) {
|
||||
assert.Nil(t, meta)
|
||||
assert.Equal(t, models.ErrLFSObjectNotExist, err)
|
||||
|
||||
req := newRequest(t, p, "")
|
||||
t.Run("InvalidAccess", func(t *testing.T) {
|
||||
req := newRequest(t, p, "invalid")
|
||||
session.MakeRequest(t, req, http.StatusUnprocessableEntity)
|
||||
})
|
||||
|
||||
session.MakeRequest(t, req, http.StatusOK)
|
||||
t.Run("ValidAccess", func(t *testing.T) {
|
||||
req := newRequest(t, p, "dummy5")
|
||||
|
||||
meta, err = repo.GetLFSMetaObjectByOid(p.Oid)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, meta)
|
||||
session.MakeRequest(t, req, http.StatusOK)
|
||||
meta, err = repo.GetLFSMetaObjectByOid(p.Oid)
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, meta)
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("MetaAlreadyExists", func(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user