def test_close_disabled(self):
# Second case: time is beyond close deadline, and there is no comment yet
# but the global option to allow closing has not been enabled. Since there
# is no comment, the warning gets posted (rather than the 'epilogue')
self.get_issues.return_value = ['123']
self.get_label_added_date.return_value = now() - 34443
self.find_comments.return_value = []
with app.app_context():
with patch.object(app, 'stale_issue_close', False):
process_issues('repo', 'installation')
assert self.submit_comment.call_count == 1
expected = ISSUE_CLOSE_WARNING.format(pasttime='9 hours ago', futuretime='5 hours')
self.submit_comment.assert_called_with(expected)
assert self.close.call_count == 0
评论列表
文章目录