Commit c4abdd4f authored by Vamshi Krishna's avatar Vamshi Krishna

MergeRequest: Add mergeable property

Closes #143
parent e2224d7d
Pipeline #25410746 passed with stages
in 32 seconds
......@@ -354,3 +354,10 @@ class GitHubMergeRequest(GitHubIssue, MergeRequest):
self.data = patch(
self._token, self.url,
{'milestone': new_milestone.number if new_milestone else ''})
@property
def mergeable(self) -> bool:
"""
Returns true if there is no merge conflict.
"""
return self.data['mergeable']
......@@ -352,3 +352,10 @@ class GitLabMergeRequest(GitLabIssue, MergeRequest):
self.data = put(
self._token, self.url,
{'milestone_id': new_milestone.number if new_milestone else ''})
@property
def mergeable(self) -> bool:
"""
Returns true if there is no merge conflict.
"""
return True if self.data['merge_status'] == 'can_be_merged' else False
......@@ -232,3 +232,10 @@ class MergeRequest(Issue):
Setter for the Milestone.
"""
raise NotImplementedError
@property
def mergeable(self) -> bool:
"""
Returns true if there is no merge conflict.
"""
raise NotImplementedError
interactions:
- request:
body: '{}'
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['2']
Content-Type: [application/json]
If-None-Match: [W/"43efdc143156f3958957e162cf5ce9ff"]
User-Agent: [IGitt]
method: GET
uri: https://api.github.com/repos/gitmate-test-user/test/issues/7?per_page=100
response:
body:
string: !!binary |
H4sIAAAAAAAAA+2XUW/aMBDHv8rkZ2gSoKFEqqZOpdUeyLSNrhXThIxjgjvHzmwHClG/+84m0MEK
26APe6h4Aefu5/Pd+X+hRIXiKEITY3IdeR7O2UnKzKQYnRCZeYrmUnuwkGFD64ZqUy80VZ795jGt
C6q9NqohZ8eMVPPhwTzAcDyiXB+OWIfkLUmlJ3BGH4EMh8moMC/CXrEAS6cvBV2SADkxGd/KwC8F
2VGKvODcFYIlKAoaZ62GH7TDGhIyoUO7hnqX3YcP/F0wun74PLi7CgZ3sR/3yazX7zbj/sU5+Ioi
G1GFonYNGWY4BS8ywSKlyZvl7xqyxUdRibhMmYDnv4WzCiEMzwK/6W9G8DH8chdzct9txPfpQ++y
NwNzPMUGq+2au0XdrHrRbkukMJBs15aFF1QbvJ2etwCSqgrjzgoLe7vQ4p7p6n9PPniMJedyBrzt
E2xepB1bemv3NYqJ9BgUuJeeNBMKKYVj2t5Pmf5T4+8Kz7mWIADaQBtZmIa6KJocFmLlDAHOBMRW
On1x1GKkiWK5YVIcmMkNBCClSrFgC3wEEhAaSE7cDjuwcwXE3+jErhosfUsvV2yKydymS1FC2RSq
cAx3CwJYM8/tpb+xlxxqwgwd4iSzF32MuaaPK4FG0dfSKU0n9JvtRqe9dc9vwv71FRvczk7j+4tF
vHh/Gi+cwuy9lXtnzVLPIQeSUK29nIrEXhRFp4xaFbE6D6HvfE4kl6BciCb2Aw4JHeOCm9XRvrnO
NpYhAQ4GXJLvYLk8OsiU1iwVFAwEaO3Tbw3JAOeMcRiJUqyfr4eElVOiKLCTIYb9EEhzWPeDeqPV
DzpRqx0FnYHNTZ5s2JzV/bAe+P2gFTWD6NTZEC51hamiKMxEqiEEJwlzrQ4bfLiNu5/A2g4FyNAP
GNKwb3lE9i1pOeiPm04JG48PnG0n1tceChsyOZThnBH08Ugmc8jUarwldK0+T1kegcXrpKve+CAt
r5PumRfkXaL9Oun2/KvYlbT/Z9I9/gSrklz0GA0AAA==
headers:
Access-Control-Allow-Origin: ['*']
Access-Control-Expose-Headers: ['ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes,
X-Poll-Interval']
Cache-Control: ['private, max-age=60, s-maxage=60']
Content-Encoding: [gzip]
Content-Security-Policy: [default-src 'none']
Content-Type: [application/json; charset=utf-8]
Date: ['Sun, 08 Jul 2018 19:09:26 GMT']
ETag: [W/"e4c8ee8f4a14e24df273516a0cbc22ef"]
Last-Modified: ['Thu, 14 Jun 2018 13:19:40 GMT']
Referrer-Policy: ['origin-when-cross-origin, strict-origin-when-cross-origin']
Server: [GitHub.com]
Status: [200 OK]
Strict-Transport-Security: [max-age=31536000; includeSubdomains; preload]
Vary: ['Accept, Authorization, Cookie, X-GitHub-OTP']
X-Accepted-OAuth-Scopes: [repo]
X-Content-Type-Options: [nosniff]
X-Frame-Options: [deny]
X-GitHub-Media-Type: [github.v3; format=json]
X-GitHub-Request-Id: ['FA09:12A3:19F5A01:36B9073:5B426164']
X-OAuth-Scopes: ['admin:gpg_key, admin:org, admin:org_hook, admin:public_key,
admin:repo_hook, gist, notifications, repo, user']
X-RateLimit-Limit: ['5000']
X-RateLimit-Remaining: ['4991']
X-RateLimit-Reset: ['1531079974']
X-Runtime-rack: ['0.090764']
X-XSS-Protection: [1; mode=block]
status: {code: 200, message: OK}
- request:
body: '{}'
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['2']
Content-Type: [application/json]
If-None-Match: [W/"5fa9851ca6b48682c75c34965d13958a"]
User-Agent: [IGitt]
method: GET
uri: https://api.github.com/repos/gitmate-test-user/test/pulls/7?per_page=100
response:
body:
string: !!binary |
H4sIAAAAAAAAA+1bbW/bNhD+K4W+Lo4kS/KLgGIvaFdsQBx0c7eiw2BQFG2rkSVPkpMmQv/7niMl
+d1JzHzYi1A0sGXew+ORPN7dI5bGKosN35gXxTL3TZMto8tZVMxXwSVPF2Ymlmlu4sGCFaJTiLzo
rHKRmfTJXK7iODf7xoURhYbv9S3b7nvWhZGkoZjQI+Pqzdsv1/EPdvDuy6+fPv5of/o4skZjfnc1
fuuMxt+/hui8WMSTbR02+j/Rs+w4jKbTM6UvSRYQS1bw+bkYUpgMkOcrsQPyHFNKeWXLZLUIRGb4
/QsjL2B1mDFdigSdxCm/ETDrlMW5uDCKqIjpVz5nyUyEr9T3C4MmyPBLNJ9FCX7fs2E1YXavN7At
Z2fC3vd++ziK+ee33dHn2ZerN1d3aM5uWcGy3fHJh7lTrRfqlqdJIZJCLp2VWXfw7e1rFyCzrIKR
SwMPTq48gjuw8iD2zBUDiWkax+kd8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HPwb3ntLeSSJbxBi17+P3v6ChFddVGuIOPmVBXSTtqLmMkGE2dajptGEFEJT
XDzOivsGbRLgxp1i+tbrDmzl3kLx0D+LkgL/cfmTs2SySHEPGdJV5yQuJ6SLYYRhJG9GGr5DDF8s
qm/g+6pLv5MphQsgBL/+DSh0+bbJPQAA
headers:
Access-Control-Allow-Origin: ['*']
Access-Control-Expose-Headers: ['ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes,
X-Poll-Interval']
Cache-Control: ['private, max-age=60, s-maxage=60']
Content-Encoding: [gzip]
Content-Security-Policy: [default-src 'none']
Content-Type: [application/json; charset=utf-8]
Date: ['Sun, 08 Jul 2018 19:09:27 GMT']
ETag: [W/"7c927ddbcff5f03d8286863fb5b80f3e"]
Last-Modified: ['Thu, 14 Jun 2018 13:19:40 GMT']
Referrer-Policy: ['origin-when-cross-origin, strict-origin-when-cross-origin']
Server: [GitHub.com]
Status: [200 OK]
Strict-Transport-Security: [max-age=31536000; includeSubdomains; preload]
Vary: ['Accept, Authorization, Cookie, X-GitHub-OTP']
X-Accepted-OAuth-Scopes: ['']
X-Content-Type-Options: [nosniff]
X-Frame-Options: [deny]
X-GitHub-Media-Type: [github.v3; format=json]
X-GitHub-Request-Id: ['FA0A:12A4:243DA01:43B9F1B:5B426166']
X-OAuth-Scopes: ['admin:gpg_key, admin:org, admin:org_hook, admin:public_key,
admin:repo_hook, gist, notifications, repo, user']
X-RateLimit-Limit: ['5000']
X-RateLimit-Remaining: ['4990']
X-RateLimit-Reset: ['1531079974']
X-Runtime-rack: ['0.110310']
X-XSS-Protection: [1; mode=block]
status: {code: 200, message: OK}
- request:
body: '{}'
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['2']
Content-Type: [application/json]
User-Agent: [IGitt]
method: GET
uri: https://api.github.com/repos/gitmate-test-user/test/issues/99?per_page=100
response:
body:
string: !!binary |
H4sIAAAAAAAAA62VXW/aMBSG/4uvKQ4FihJpmtStnbiAam06oU5T5DgmuHPszHZoIeK/79gEKEij
A1XiIjjnfc7x+UqNKi1QhGbWlibCmJS8nXM7q9I2VQXWrFQGw0FBLLuwzNiLyjCN3RPmxlTM4DBE
LeQNuVV6kZwNBIwgKRPmfMQuJrxG1ViSgq0ADdcpmLQfA9/AgMvmH0Zdo4A5s4U4SMKbovyjHGUl
xLoYPEPRZa/T7/fCIGghqTKWuDM0+nrzeieuO+m314enyW3naTIORvGwP45pd7TMF+BaVkXKNIrC
sIUst4KBjGQZvHGFR1GNhMq5hFOqyJTD+xby/sJBd3A1ANVbd9+vfkzGgj6Di+WoO36mfTAnc2KJ
PiyyPzRB033OGVXSQm59I1Z44+Dz/FMPILluMP5iLrxjfexwBu8iPp7gnd1UCaFeQHsY7f6Y7OHx
VgRRrZ+5zE8HgKjGys4YpArCdz2cc/NeA++H4gU1DLCx0AEOYSDLmmWnhNNIIJgXCXHUfit4VpUa
qnlpuZInZWhPCCClcyL5kpwMAqEBvd8+p1zJC0D4P8O7n9G1osal5nNCFy4NmlHG55DT02kHUoDZ
RelG7tENG2SYW5aQrHADNyXCsNVmR6Lo5y9fTevMVckkmAtFfzOYB28Kg2YMzyUDAwm7YfffrMUF
TK+xSm7fb7daBFuDagbsLCEW+JdBZ3ARwC+ML4OoG0bd3hP4q8rsXRsqlGkwTRSVnSmdQHCKcl9y
cHA7vH+Ik3g4ukm+3I3j++H1Y3x3Dy7cVks0+wNfGgikPj7mRz9XjtR8rY6P/7v7NePT6bnrue3E
7l7E0tnZEK9G0Aypyhab8jaZTpuD1V/ZjEq+3AcAAA==
headers:
Access-Control-Allow-Origin: ['*']
Access-Control-Expose-Headers: ['ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes,
X-Poll-Interval']
Cache-Control: ['private, max-age=60, s-maxage=60']
Content-Encoding: [gzip]
Content-Security-Policy: [default-src 'none']
Content-Type: [application/json; charset=utf-8]
Date: ['Sun, 08 Jul 2018 19:09:29 GMT']
ETag: [W/"a5e4c9c63f684cdeb8d198c3aeeea064"]
Last-Modified: ['Mon, 04 Dec 2017 19:02:02 GMT']
Referrer-Policy: ['origin-when-cross-origin, strict-origin-when-cross-origin']
Server: [GitHub.com]
Status: [200 OK]
Strict-Transport-Security: [max-age=31536000; includeSubdomains; preload]
Vary: ['Accept, Authorization, Cookie, X-GitHub-OTP']
X-Accepted-OAuth-Scopes: [repo]
X-Content-Type-Options: [nosniff]
X-Frame-Options: [deny]
X-GitHub-Media-Type: [github.v3; format=json]
X-GitHub-Request-Id: ['FA0B:12A4:243DAD8:43BA0CA:5B426168']
X-OAuth-Scopes: ['admin:gpg_key, admin:org, admin:org_hook, admin:public_key,
admin:repo_hook, gist, notifications, repo, user']
X-RateLimit-Limit: ['5000']
X-RateLimit-Remaining: ['4989']
X-RateLimit-Reset: ['1531079974']
X-Runtime-rack: ['0.088084']
X-XSS-Protection: [1; mode=block]
status: {code: 200, message: OK}
- request:
body: '{}'
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['2']
Content-Type: [application/json]
User-Agent: [IGitt]
method: GET
uri: https://api.github.com/repos/gitmate-test-user/test/pulls/99?per_page=100
response:
body:
string: !!binary |
H4sIAAAAAAAAA+1abW+jOBD+Kyu+XlsgQBKQVnva2xftSWm13eyp2tMpMsZJ3BLIgZNui/rfb8aG
QEI2KXV0n6p9UTDM4/F4ZjwvLoxVFhuBMRdimQemSZb8YsbFfBVe0HRhZmyZ5iYMLIhg54Ll4nyV
s8zEX+ZyFce56fvGmcEjI7B7vjcYOMPemZGkEZvgmDH68PHnVfzeDj///Pbj5pP94+bSGo2/eJdj
6oweZw9AOxeLeLLNRYODA3OrqSM+nb6U/AKJgYUlEXT+YhBJjULI8xXbQekiT0l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YcmdPdWNyo7WYk52B7kvCnl
8tADY/j05frbeDL+Mvo4+ePqcnz95f338dU1+Bl1cWNjyPKRhHiNSzmJjGEM1RzZfDJB/rBmTeFw
wutg5SWQsL5uUnX+0UBbmgNjC8ITAf/gzhIlyWSRwi04oFZTl3GytG64UsblbZ/S1mNWP9E5pGNw
XODtMnz/9B/jBzUESigAAA==
headers:
Access-Control-Allow-Origin: ['*']
Access-Control-Expose-Headers: ['ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit,
X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes,
X-Poll-Interval']
Cache-Control: ['private, max-age=60, s-maxage=60']
Content-Encoding: [gzip]
Content-Security-Policy: [default-src 'none']
Content-Type: [application/json; charset=utf-8]
Date: ['Sun, 08 Jul 2018 19:09:31 GMT']
ETag: [W/"138318ec5e71ab7de398b73f0faaa2be"]
Last-Modified: ['Mon, 04 Dec 2017 19:02:02 GMT']
Referrer-Policy: ['origin-when-cross-origin, strict-origin-when-cross-origin']
Server: [GitHub.com]
Status: [200 OK]
Strict-Transport-Security: [max-age=31536000; includeSubdomains; preload]
Vary: ['Accept, Authorization, Cookie, X-GitHub-OTP']
X-Accepted-OAuth-Scopes: ['']
X-Content-Type-Options: [nosniff]
X-Frame-Options: [deny]
X-GitHub-Media-Type: [github.v3; format=json]
X-GitHub-Request-Id: ['FA0C:12A4:243DBBD:43BA29B:5B42616A']
X-OAuth-Scopes: ['admin:gpg_key, admin:org, admin:org_hook, admin:public_key,
admin:repo_hook, gist, notifications, repo, user']
X-RateLimit-Limit: ['5000']
X-RateLimit-Remaining: ['4988']
X-RateLimit-Reset: ['1531079974']
X-Runtime-rack: ['0.108333']
X-XSS-Protection: [1; mode=block]
status: {code: 200, message: OK}
version: 1
......@@ -164,3 +164,8 @@ class GitHubMergeRequestTest(IGittTestCase):
'Permanent IGitt test milestone. DO NOT DELETE.')
merge_request.milestone = None
self.assertEqual(merge_request.milestone, None)
def test_mergeable(self):
self.assertFalse(self.mr.mergeable)
test_mr = GitHubMergeRequest(self.token, 'gitmate-test-user/test', 99)
self.assertTrue(test_mr.mergeable)
interactions:
- request:
body: '{}'
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['2']
Content-Type: [application/json]
If-None-Match: [W/"930b21e7d9f2cbfa7dfc936bd83a456a"]
User-Agent: [IGitt]
method: GET
uri: https://gitlab.com/api/v4/projects/gitmate-test-user%2Ftest/merge_requests/7?per_page=100
response:
body: {string: "{\"id\":3761791,\"iid\":7,\"project_id\":3439658,\"title\":\"\
Update README.md\",\"description\":\"\",\"state\":\"opened\",\"created_at\"\
:\"2017-06-07T12:01:20.476Z\",\"updated_at\":\"2018-04-26T09:56:09.515Z\"\
,\"target_branch\":\"master\",\"source_branch\":\"gitmate-test-user-patch-2\"\
,\"upvotes\":0,\"downvotes\":0,\"author\":{\"id\":889700,\"name\":\"Naveen\
\ Kumar Sangi\U0001F984\",\"username\":\"nkprince007\",\"state\":\"active\"\
,\"avatar_url\":\"https://secure.gravatar.com/avatar/2ed27920a4ec4445d0e390a30df7145d?s=80\\\
u0026d=identicon\",\"web_url\":\"https://gitlab.com/nkprince007\"},\"assignee\"\
:null,\"source_project_id\":3439658,\"target_project_id\":3439658,\"labels\"\
:[],\"work_in_progress\":false,\"milestone\":null,\"merge_when_pipeline_succeeds\"\
:false,\"merge_status\":\"cannot_be_merged\",\"sha\":\"f6d2b7c66372236a090a2a74df2e47f42a54456b\"\
,\"merge_commit_sha\":null,\"user_notes_count\":11,\"discussion_locked\":null,\"\
should_remove_source_branch\":null,\"force_remove_source_branch\":null,\"\
web_url\":\"https://gitlab.com/gitmate-test-user/test/merge_requests/7\",\"\
time_stats\":{\"time_estimate\":0,\"total_time_spent\":0,\"human_time_estimate\"\
:null,\"human_total_time_spent\":null},\"squash\":false,\"subscribed\":true,\"\
changes_count\":\"1\",\"merged_by\":null,\"merged_at\":null,\"closed_by\"\
:null,\"closed_at\":null,\"latest_build_started_at\":null,\"latest_build_finished_at\"\
:null,\"first_deployed_to_production_at\":null,\"pipeline\":null,\"diff_refs\"\
:{\"base_sha\":\"674498fd415cfadc35c5eb28b8951e800f357c6f\",\"head_sha\":\"\
f6d2b7c66372236a090a2a74df2e47f42a54456b\",\"start_sha\":\"20d99d2b6124ccef9e9593749357a10c79085dae\"\
},\"approvals_before_merge\":null}"}
headers:
Cache-Control: ['max-age=0, private, must-revalidate']
Content-Length: ['1538']
Content-Type: [application/json]
Date: ['Sun, 08 Jul 2018 19:12:13 GMT']
Etag: [W/"89d51dba47f646094451f39a6bb6bd52"]
RateLimit-Limit: ['600']
RateLimit-Observed: ['1']
RateLimit-Remaining: ['599']
RateLimit-Reset: ['1531077193']
RateLimit-ResetTime: ['Mon, 08 Jul 2018 19:13:13 GMT']
Server: [nginx]
Strict-Transport-Security: [max-age=31536000]
Vary: [Origin]
X-Content-Type-Options: [nosniff]
X-Frame-Options: [SAMEORIGIN]
X-Request-Id: [0b2c7203-8eda-4d64-8216-057a6b1a5454]
X-Runtime: ['0.328963']
status: {code: 200, message: OK}
- request:
body: '{}'
headers:
Accept: ['*/*']
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Length: ['2']
Content-Type: [application/json]
If-None-Match: [W/"30aedda44009fba69789577cd8c90f0b"]
User-Agent: [IGitt]
method: GET
uri: https://gitlab.com/api/v4/projects/gitmate-test-user%2Ftest/merge_requests/25?per_page=100
response:
body: {string: "{\"id\":4445169,\"iid\":25,\"project_id\":3439658,\"title\":\"\
Create a.txt\",\"description\":\"Awesome commit message\\n\\nFix #21, Fixes\
\ #22 and Closes gitmate-test-user/test#23.\\nThis commit is also related\
\ to #31 and fixes #26, #27\\nand https://gitlab.com/gitmate-test-user/test/issues/30.\"\
,\"state\":\"opened\",\"created_at\":\"2017-07-28T20:00:27.022Z\",\"updated_at\"\
:\"2018-06-26T08:01:10.728Z\",\"target_branch\":\"master\",\"source_branch\"\
:\"test-issue-pr-relate\",\"upvotes\":0,\"downvotes\":0,\"author\":{\"id\"\
:889700,\"name\":\"Naveen Kumar Sangi\U0001F984\",\"username\":\"nkprince007\"\
,\"state\":\"active\",\"avatar_url\":\"https://secure.gravatar.com/avatar/2ed27920a4ec4445d0e390a30df7145d?s=80\\\
u0026d=identicon\",\"web_url\":\"https://gitlab.com/nkprince007\"},\"assignee\"\
:null,\"source_project_id\":3439658,\"target_project_id\":3439658,\"labels\"\
:[],\"work_in_progress\":false,\"milestone\":null,\"merge_when_pipeline_succeeds\"\
:false,\"merge_status\":\"can_be_merged\",\"sha\":\"9ba5b704f5866e468ec2e639fa893ae4c129f2ad\"\
,\"merge_commit_sha\":null,\"user_notes_count\":1,\"discussion_locked\":null,\"\
should_remove_source_branch\":null,\"force_remove_source_branch\":false,\"\
web_url\":\"https://gitlab.com/gitmate-test-user/test/merge_requests/25\"\
,\"time_stats\":{\"time_estimate\":0,\"total_time_spent\":0,\"human_time_estimate\"\
:null,\"human_total_time_spent\":null},\"squash\":false,\"subscribed\":true,\"\
changes_count\":\"1\",\"merged_by\":null,\"merged_at\":null,\"closed_by\"\
:null,\"closed_at\":null,\"latest_build_started_at\":null,\"latest_build_finished_at\"\
:\"2017-09-24T12:09:30.935Z\",\"first_deployed_to_production_at\":null,\"\
pipeline\":{\"id\":12080175,\"sha\":\"9ba5b704f5866e468ec2e639fa893ae4c129f2ad\"\
,\"ref\":\"test-issue-pr-relate\",\"status\":\"running\"},\"diff_refs\":{\"\
base_sha\":\"515280bfe8488e1b403e0dd95c41a404355ca184\",\"head_sha\":\"9ba5b704f5866e468ec2e639fa893ae4c129f2ad\"\
,\"start_sha\":\"515280bfe8488e1b403e0dd95c41a404355ca184\"},\"approvals_before_merge\"\
:null}"}
headers:
Cache-Control: ['max-age=0, private, must-revalidate']
Content-Length: ['1853']
Content-Type: [application/json]
Date: ['Sun, 08 Jul 2018 19:12:14 GMT']
Etag: [W/"e45c23c1afaf2473481c22767739babc"]
RateLimit-Limit: ['600']
RateLimit-Observed: ['2']
RateLimit-Remaining: ['598']
RateLimit-Reset: ['1531077194']
RateLimit-ResetTime: ['Mon, 08 Jul 2018 19:13:14 GMT']
Server: [nginx]
Strict-Transport-Security: [max-age=31536000]
Vary: [Origin]
X-Content-Type-Options: [nosniff]
X-Frame-Options: [SAMEORIGIN]
X-Request-Id: [cac39aa0-a29d-4a2e-a0e7-7efb660cda82]
X-Runtime: ['0.167591']
status: {code: 200, message: OK}
version: 1
......@@ -162,3 +162,8 @@ class GitLabMergeRequestTest(IGittTestCase):
'Permanent IGitt test milestone. DO NOT DELETE.')
merge_request.milestone = None
self.assertEqual(merge_request.milestone, None)
def test_mergeable(self):
self.assertFalse(self.mr.mergeable)
test_mr = GitLabMergeRequest(self.token, 'gitmate-test-user/test', 25)
self.assertTrue(test_mr.mergeable)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment