Skip to content

Commit e1ae4fb

Browse files
committed
extend test
1 parent 50c1fd8 commit e1ae4fb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

integrations/api_repo_git_commits_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ func TestDownloadCommitDiffOrPatch(t *testing.T) {
119119

120120
// Test getting diff
121121
reqDiff := NewRequestf(t, "GET", "/api/v1/repos/%s/repo16/git/commits/f27c2b2b03dcab38beaf89b0ab4ff61f6de63441.diff?token="+token, user.Name)
122-
session.MakeRequest(t, reqDiff, http.StatusOK)
122+
resp := session.MakeRequest(t, reqDiff, http.StatusOK)
123+
assert.EqualValues(t, "commit f27c2b2b03dcab38beaf89b0ab4ff61f6de63441\nAuthor: User2 <user2@example.com>\nDate: Sun Aug 6 19:55:01 2017 +0200\n\n good signed commit\n\ndiff --git a/readme.md b/readme.md\nnew file mode 100644\nindex 0000000..458121c\n--- /dev/null\n+++ b/readme.md\n@@ -0,0 +1 @@\n+good sign\n", string(resp.Body.Bytes()))
123124

124125
// Test getting patch
125126
reqPatch := NewRequestf(t, "GET", "/api/v1/repos/%s/repo16/git/commits/f27c2b2b03dcab38beaf89b0ab4ff61f6de63441.patch?token="+token, user.Name)
126-
session.MakeRequest(t, reqPatch, http.StatusOK)
127+
resp = session.MakeRequest(t, reqPatch, http.StatusOK)
128+
assert.EqualValues(t, "From f27c2b2b03dcab38beaf89b0ab4ff61f6de63441 Mon Sep 17 00:00:00 2001\nFrom: User2 <user2@example.com>\nDate: Sun, 6 Aug 2017 19:55:01 +0200\nSubject: [PATCH] good signed commit\n\n---\n readme.md | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 readme.md\n\ndiff --git a/readme.md b/readme.md\nnew file mode 100644\nindex 0000000..458121c\n--- /dev/null\n+++ b/readme.md\n@@ -0,0 +1 @@\n+good sign\n", string(resp.Body.Bytes()))
127129
}

0 commit comments

Comments
 (0)