* Test if object is accessible. * Added more logging. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
parent
3ac1f35349
commit
cbe3ca5d0b
2 changed files with 60 additions and 19 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue