Skip to content

Parse delegate= while stripping @ #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homu/parse_issue_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def delegate_author(cls):
@classmethod
def delegate(cls, delegate_to):
command = cls('delegate')
command.delegate_to = delegate_to
command.delegate_to = delegate_to.lstrip('@')
return command

@classmethod
Expand Down
15 changes: 15 additions & 0 deletions homu/tests/test_parse_issue_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,21 @@ def test_delegate_equals():
assert command.delegate_to == 'jill'


def test_delegate_equals_at_user():
"""
@bors delegate=@{username}
"""

author = "jack"
body = "@bors delegate=@jill"
commands = parse_issue_comment(author, body, commit, "bors")

assert len(commands) == 1
command = commands[0]
assert command.action == 'delegate'
assert command.delegate_to == 'jill'


def test_delegate_minus():
"""
@bors delegate-
Expand Down