From fcee0ae7268df4e79b4fb99a2680c969594d3380 Mon Sep 17 00:00:00 2001 From: Pawel Lipski Date: Fri, 8 Nov 2024 12:28:55 +0100 Subject: [PATCH] Improve the test --- tests/test_github_retarget_pr.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/test_github_retarget_pr.py b/tests/test_github_retarget_pr.py index d642aa776..50ebb997a 100644 --- a/tests/test_github_retarget_pr.py +++ b/tests/test_github_retarget_pr.py @@ -421,15 +421,13 @@ def test_github_retarget_pr_multiple_non_origin_remotes(self, mocker: MockerFixt self.repo_sandbox.check_out('feature') self.repo_sandbox.remove_remote('origin_2') - self.repo_sandbox.set_git_config_key("machete.github.prDescriptionIntroStyle", "full") assert_success( ['github', 'retarget-pr', '-U'], """ Base branch of PR #15 has been switched to branch-1 - Checking for open GitHub PRs... OK - Description of PR #15 has been updated Updating descriptions of other PRs... + Checking for open GitHub PRs... OK Description of PR #20 (feature_1 -> feature) has been updated Description of PR #25 (feature_2 -> feature) has been updated Description of PR #35 (feature_4 -> feature) has been updated @@ -438,6 +436,21 @@ def test_github_retarget_pr_multiple_non_origin_remotes(self, mocker: MockerFixt pr15 = github_api_state.get_pull_by_number(15) assert pr15 is not None assert pr15['base']['ref'] == 'branch-1' + assert pr15['body'] == '# Summary' + + self.repo_sandbox.set_git_config_key("machete.github.prDescriptionIntroStyle", "full") + assert_success( + ['github', 'retarget-pr', '-U'], + """ + Base branch of PR #15 is already branch-1 + Checking for open GitHub PRs... OK + Description of PR #15 has been updated + Updating descriptions of other PRs... + """ + ) + pr15 = github_api_state.get_pull_by_number(15) + assert pr15 is not None + assert pr15['base']['ref'] == 'branch-1' assert pr15['body'] == textwrap.dedent('''