Skip to content

Commit

Permalink
test release
Browse files Browse the repository at this point in the history
[release:0.1]
  • Loading branch information
heitorpolidoro committed Jan 19, 2024
1 parent 11147d5 commit fddc337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
CheckSuiteRequestedEvent,
IssueEditedEvent,
IssueOpenedEvent,
CheckSuiteRerequestedEvent,
)
from githubapp.events.issues import IssueClosedEvent, IssuesEvent

Expand Down Expand Up @@ -50,6 +51,7 @@ def sentry_init():


@webhook_handler.add_handler(CheckSuiteRequestedEvent)
@webhook_handler.add_handler(CheckSuiteRerequestedEvent)
def handle_check_suite_requested(event: CheckSuiteRequestedEvent):
"""
Handle the Check Suite Requested Event, doing:
Expand All @@ -73,7 +75,7 @@ def handle_issue(event: IssuesEvent):
:param event:
:return:
"""
if Config.is_issue_manager_enabled and event.issue.body:
if Config.is_issue_manager_enabled and event.issue and event.issue.body:
if isinstance(event, IssueClosedEvent):
handle_close_tasklist(event)
else:
Expand Down
5 changes: 4 additions & 1 deletion tests/managers/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ def test_handle_release_when_there_is_a_command(event, repository, pull_request)
)


def test_handle_release_when_head_branch_is_the_default_branch(event, repository):
def test_handle_release_when_head_branch_is_the_default_branch(event, repository, pull_request):
event.check_suite.head_branch = repository.default_branch
commit = Mock(commit=Mock(message="[release:1.2.3]"))
pull_request.get_commits.return_value.reversed = [commit]
assert handle_release(event) is True
repository.create_git_release.assert_called_once_with(tag="1.2.3", generate_release_notes=True)


def test_handle_release_when_there_is_no_pull_request(event, repository):
Expand Down

0 comments on commit fddc337

Please sign in to comment.