Skip to content

Commit

Permalink
Improve the test
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelLipski committed Nov 8, 2024
1 parent 17468c7 commit fcee0ae
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tests/test_github_retarget_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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('''
<!-- start git-machete generated -->
Expand Down

0 comments on commit fcee0ae

Please sign in to comment.