@@ -291,7 +291,7 @@ def test_skip_pr_comment(self, bot_env):
291291 },
292292 }
293293 )
294- assert not bot .handle_issue_comment ()
294+ assert bot .handle_issue_comment ()
295295
296296 def test_non_assignment_comment (self , bot_env ):
297297 bot = IssueAssignmentBot ()
@@ -304,7 +304,7 @@ def test_non_assignment_comment(self, bot_env):
304304 },
305305 }
306306 )
307- assert not bot .handle_issue_comment ()
307+ assert bot .handle_issue_comment ()
308308
309309 def test_no_payload (self , bot_env ):
310310 bot = IssueAssignmentBot ()
@@ -373,6 +373,22 @@ def test_closed(self, bot_env):
373373 assert bot .handle_pull_request ()
374374 mock_issue .remove_from_assignees .assert_called_once_with ("testuser" )
375375
376+ def test_merged_does_not_unassign (self , bot_env ):
377+ bot = IssueAssignmentBot ()
378+ bot .load_event_payload (
379+ {
380+ "action" : "closed" ,
381+ "pull_request" : {
382+ "number" : 100 ,
383+ "user" : {"login" : "testuser" },
384+ "body" : "Fixes #123" ,
385+ "merged" : True ,
386+ },
387+ }
388+ )
389+ assert bot .handle_pull_request ()
390+ bot_env ["repo" ].get_issue .assert_not_called ()
391+
376392 def test_unsupported_action (self , bot_env ):
377393 bot = IssueAssignmentBot ()
378394 bot .load_event_payload (
@@ -385,7 +401,7 @@ def test_unsupported_action(self, bot_env):
385401 },
386402 }
387403 )
388- assert not bot .handle_pull_request ()
404+ assert bot .handle_pull_request ()
389405
390406
391407class TestRun :
@@ -431,7 +447,7 @@ def test_pull_request_event(self, bot_env):
431447 def test_unsupported_event (self , bot_env ):
432448 bot = IssueAssignmentBot ()
433449 bot .event_name = "push"
434- assert not bot .run ()
450+ assert bot .run ()
435451
436452 def test_no_github_client (self , bot_env ):
437453 bot = IssueAssignmentBot ()
0 commit comments