diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-01-08 22:15:07 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-09 11:15:07 +0800 |
commit | 973282dae2ba5153470ea96b022066b72c53ea62 (patch) | |
tree | a38b902073489dd3b3698ab45f3d2c6512af129e /models/pull_test.go | |
parent | 862948ab881559e096e2d6670f2df7345079544a (diff) | |
download | gitea-973282dae2ba5153470ea96b022066b72c53ea62.tar.gz gitea-973282dae2ba5153470ea96b022066b72c53ea62.zip |
Better coverage in pull_test (#615)
Diffstat (limited to 'models/pull_test.go')
-rw-r--r-- | models/pull_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/pull_test.go b/models/pull_test.go index 2cfc9f7729..402b00962c 100644 --- a/models/pull_test.go +++ b/models/pull_test.go @@ -37,6 +37,9 @@ func TestPullRequest_LoadIssue(t *testing.T) { assert.NoError(t, pr.LoadIssue()) assert.NotNil(t, pr.Issue) 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 @@ -47,6 +50,9 @@ func TestPullRequest_GetBaseRepo(t *testing.T) { assert.NoError(t, pr.GetBaseRepo()) assert.NotNil(t, pr.BaseRepo) 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) { @@ -231,6 +237,8 @@ func TestPullRequestList_LoadAttributes(t *testing.T) { assert.NotNil(t, pr.Issue) assert.Equal(t, pr.IssueID, pr.Issue.ID) } + + assert.NoError(t, PullRequestList([]*PullRequest{}).LoadAttributes()) } // TODO TestAddTestPullRequestTask |