mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-29 08:45:31 +02:00
Fix tests
This commit is contained in:
parent
361ca4002e
commit
2b830ee904
@ -131,3 +131,24 @@
|
|||||||
commit_time: 1489956479
|
commit_time: 1489956479
|
||||||
pusher_id: 1
|
pusher_id: 1
|
||||||
is_deleted: false
|
is_deleted: false
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 20
|
||||||
|
repo_id: 1
|
||||||
|
name: 'pr-to-update'
|
||||||
|
commit_id: '62fb502a7172d4453f0322a2cc85bddffa57f07a'
|
||||||
|
commit_message: 'add WoW File'
|
||||||
|
commit_time: 1579200695
|
||||||
|
pusher_id: 1
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 21
|
||||||
|
repo_id: 10
|
||||||
|
name: 'develop'
|
||||||
|
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||||
|
commit_message: 'Initial commit'
|
||||||
|
commit_time: 1489927679
|
||||||
|
pusher_id: 12
|
||||||
|
is_deleted: false
|
||||||
|
deleted_by_id: 0
|
||||||
|
deleted_unix: 0
|
@ -204,6 +204,8 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
|
|||||||
ctx.NotFound("GetRepositoryByOwnerAndName", nil)
|
ctx.NotFound("GetRepositoryByOwnerAndName", nil)
|
||||||
case errors.Is(err, util.ErrInvalidArgument):
|
case errors.Is(err, util.ErrInvalidArgument):
|
||||||
ctx.NotFound("ParseComparePathParams", nil)
|
ctx.NotFound("ParseComparePathParams", nil)
|
||||||
|
case git.IsErrNotExist(err):
|
||||||
|
ctx.NotFound("ParseComparePathParams", nil)
|
||||||
default:
|
default:
|
||||||
ctx.ServerError("GetRepositoryByOwnerAndName", err)
|
ctx.ServerError("GetRepositoryByOwnerAndName", err)
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ func TestAPICreateBranchWithSyncBranches(t *testing.T) {
|
|||||||
RepoID: 1,
|
RepoID: 1,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Len(t, branches, 4)
|
assert.Len(t, branches, 7)
|
||||||
|
|
||||||
// make a broke repository with no branch on database
|
// make a broke repository with no branch on database
|
||||||
_, err = db.DeleteByBean(db.DefaultContext, git_model.Branch{RepoID: 1})
|
_, err = db.DeleteByBean(db.DefaultContext, git_model.Branch{RepoID: 1})
|
||||||
@ -287,7 +287,7 @@ func TestAPICreateBranchWithSyncBranches(t *testing.T) {
|
|||||||
RepoID: 1,
|
RepoID: 1,
|
||||||
})
|
})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Len(t, branches, 5)
|
assert.Len(t, branches, 8)
|
||||||
|
|
||||||
branches, err = db.Find[git_model.Branch](db.DefaultContext, git_model.FindBranchOptions{
|
branches, err = db.Find[git_model.Branch](db.DefaultContext, git_model.FindBranchOptions{
|
||||||
RepoID: 1,
|
RepoID: 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user