File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -185,6 +185,12 @@ def _update_attributes(self, pull):
185
185
#: Dictionary of _links. Changed in 1.0
186
186
self .links = self ._get_attribute (pull , '_links' , {})
187
187
188
+ #: If unmerged, holds the sha of the commit to test mergability.
189
+ #: If merged, holds commit sha of the merge commit, squashed commit on
190
+ #: the base branch or the commit that the base branch was updated to
191
+ #: after rebasing the PR.
192
+ self .merge_commit_sha = self ._get_attribute (pull , 'merge_commit_sha' )
193
+
188
194
#: Boolean representing whether the pull request has been merged
189
195
self .merged = self ._get_attribute (pull , 'merged' )
190
196
Original file line number Diff line number Diff line change @@ -144,6 +144,13 @@ def test_update(self):
144
144
}
145
145
)
146
146
147
+ def test_attributes (self ):
148
+ """Show that we extract attributes correctly."""
149
+ assert self .instance .merge_commit_sha == \
150
+ 'e5bd3914e2e596debea16f433f57875b5b90bcd6'
151
+ assert not self .instance .merged
152
+ assert self .instance .mergeable
153
+
147
154
148
155
class TestPullRequestRequiresAuthentication (
149
156
helper .UnitRequiresAuthenticationHelper ):
You can’t perform that action at this time.
0 commit comments