Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 2, 2022
1 parent e50a1c1 commit 7e0c185
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/oca_github_bot/tasks/migration_issue_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def migration_issue_start(org, repo, pr, username, module=None, dry_run=False):
)
return
# Change issue to add the PR in the module list
new_body = _set_lines_issue(gh_pr.user.login, gh_pr.number, issue.body, module)
new_body = _set_lines_issue(
gh_pr.user.login, gh_pr.number, issue.body, module
)
issue.edit(body=new_body)
except Exception as e:
github.gh_call(
Expand Down
15 changes: 6 additions & 9 deletions tests/test_migration_issue_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,26 @@ def test_set_lines_issue(gh):

body_transformation = [
(
"Issue with no list"
,
"Issue with no list",
f"Issue with no list\n"
f"- [ ] {module} - By @{gh_pr_user_login} - #{gh_pr_number}"
f"- [ ] {module} - By @{gh_pr_user_login} - #{gh_pr_number}",
),
(
"Issue with list but not the module\n"
"- [ ] a_module_1 - By @legalsylvain - #1\n"
"- [ ] z_module_1 - By @pedrobaeza - #2"
,
"- [ ] z_module_1 - By @pedrobaeza - #2",
f"Issue with list but not the module\n"
f"- [ ] a_module_1 - By @legalsylvain - #1\n"
f"- [ ] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
f"- [ ] z_module_1 - By @pedrobaeza - #2"
f"- [ ] z_module_1 - By @pedrobaeza - #2",
),
(
f"Issue with list containing the module\n"
f"- [x] {module} - By @legalsylvain - #1\n"
f"- [ ] z_module_1 - By @pedrobaeza - #2"
,
f"- [ ] z_module_1 - By @pedrobaeza - #2",
f"Issue with list containing the module\n"
f"- [x] {module} - By @{gh_pr_user_login} - #{gh_pr_number}\n"
f"- [ ] z_module_1 - By @pedrobaeza - #2"
f"- [ ] z_module_1 - By @pedrobaeza - #2",
),
]
for (old_body, new_body_expected) in body_transformation:
Expand Down

0 comments on commit 7e0c185

Please sign in to comment.