@@ -87,6 +87,7 @@ async def test_process_publish_check(
8787 event_path = Path (__file__ ).parent .parent / "plugin-test" / "issue-open.json"
8888 event = Adapter .payload_to_event ("1" , "issues" , event_path .read_bytes ())
8989 assert isinstance (event , IssuesOpened )
90+ event .payload .issue .title = "Bot: test"
9091
9192 ctx .should_call_api (
9293 "rest.apps.async_get_repo_installation" ,
@@ -276,6 +277,7 @@ async def test_edit_title(app: App, mocker: MockerFixture, tmp_path: Path) -> No
276277 event_path = Path (__file__ ).parent .parent / "plugin-test" / "issue-open.json"
277278 event = Adapter .payload_to_event ("1" , "issues" , event_path .read_bytes ())
278279 assert isinstance (event , IssuesOpened )
280+ event .payload .issue .title = "Bot: test"
279281
280282 ctx .should_call_api (
281283 "rest.apps.async_get_repo_installation" ,
@@ -469,6 +471,7 @@ async def test_process_publish_check_not_pass(
469471 event_path = Path (__file__ ).parent .parent / "plugin-test" / "issue-open.json"
470472 event = Adapter .payload_to_event ("1" , "issues" , event_path .read_bytes ())
471473 assert isinstance (event , IssuesOpened )
474+ event .payload .issue .title = "Bot: test"
472475
473476 ctx .should_call_api (
474477 "rest.apps.async_get_repo_installation" ,
@@ -625,18 +628,6 @@ async def test_not_publish_issue(app: App, mocker: MockerFixture) -> None:
625628 "subprocess.run" , side_effect = lambda * args , ** kwargs : mocker .MagicMock ()
626629 )
627630
628- mock_installation = mocker .MagicMock ()
629- mock_installation .id = 123
630- mock_installation_resp = mocker .MagicMock ()
631- mock_installation_resp .parsed_data = mock_installation
632-
633- mock_issue = mocker .MagicMock ()
634- mock_issue .pull_request = None
635- mock_issue .state = "open"
636- mock_issue .title = "test"
637- mock_issues_resp = mocker .MagicMock ()
638- mock_issues_resp .parsed_data = mock_issue
639-
640631 async with app .test_matcher (publish_check_matcher ) as ctx :
641632 adapter = get_adapter (Adapter )
642633 bot = ctx .create_bot (
@@ -648,26 +639,12 @@ async def test_not_publish_issue(app: App, mocker: MockerFixture) -> None:
648639 event_path = Path (__file__ ).parent .parent / "plugin-test" / "issue-open.json"
649640 event = Adapter .payload_to_event ("1" , "issues" , event_path .read_bytes ())
650641 assert isinstance (event , IssuesOpened )
651-
652- ctx .should_call_api (
653- "rest.apps.async_get_repo_installation" ,
654- {"owner" : "he0119" , "repo" : "action-test" },
655- mock_installation_resp ,
656- )
657- ctx .should_call_api (
658- "rest.issues.async_get" ,
659- {"owner" : "he0119" , "repo" : "action-test" , "issue_number" : 80 },
660- mock_issues_resp ,
661- )
642+ event .payload .issue .title = "test"
662643
663644 ctx .receive_event (bot , event )
664645
665646 mock_httpx .assert_not_called ()
666- mock_subprocess_run .assert_called_once_with (
667- ["git" , "config" , "--global" , "safe.directory" , "*" ],
668- check = True ,
669- capture_output = True ,
670- )
647+ mock_subprocess_run .assert_not_called ()
671648
672649
673650async def test_comment_by_self (app : App , mocker : MockerFixture ) -> None :
0 commit comments