1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Better coverage in pull_test (#615)

This commit is contained in:
Ethan Koenig 2017-01-08 22:15:07 -05:00 committed by Lunny Xiao
parent 862948ab88
commit 973282dae2

View File

@ -37,6 +37,9 @@ func TestPullRequest_LoadIssue(t *testing.T) {
assert.NoError(t, pr.LoadIssue()) assert.NoError(t, pr.LoadIssue())
assert.NotNil(t, pr.Issue) assert.NotNil(t, pr.Issue)
assert.Equal(t, int64(2), pr.Issue.ID) assert.Equal(t, int64(2), pr.Issue.ID)
assert.NoError(t, pr.LoadIssue())
assert.NotNil(t, pr.Issue)
assert.Equal(t, int64(2), pr.Issue.ID)
} }
// TODO TestPullRequest_APIFormat // TODO TestPullRequest_APIFormat
@ -47,6 +50,9 @@ func TestPullRequest_GetBaseRepo(t *testing.T) {
assert.NoError(t, pr.GetBaseRepo()) assert.NoError(t, pr.GetBaseRepo())
assert.NotNil(t, pr.BaseRepo) assert.NotNil(t, pr.BaseRepo)
assert.Equal(t, pr.BaseRepoID, pr.BaseRepo.ID) assert.Equal(t, pr.BaseRepoID, pr.BaseRepo.ID)
assert.NoError(t, pr.GetBaseRepo())
assert.NotNil(t, pr.BaseRepo)
assert.Equal(t, pr.BaseRepoID, pr.BaseRepo.ID)
} }
func TestPullRequest_GetHeadRepo(t *testing.T) { func TestPullRequest_GetHeadRepo(t *testing.T) {
@ -231,6 +237,8 @@ func TestPullRequestList_LoadAttributes(t *testing.T) {
assert.NotNil(t, pr.Issue) assert.NotNil(t, pr.Issue)
assert.Equal(t, pr.IssueID, pr.Issue.ID) assert.Equal(t, pr.IssueID, pr.Issue.ID)
} }
assert.NoError(t, PullRequestList([]*PullRequest{}).LoadAttributes())
} }
// TODO TestAddTestPullRequestTask // TODO TestAddTestPullRequestTask