Assign reviewers and assignees when pushing pull request #84

Closed
Jmaa wants to merge 3 commits from issue-41-assign-reviewers-and-assignees-when-pushing-pull-request into main
2 changed files with 22 additions and 16 deletions
Showing only changes of commit 1371343ff4 - Show all commits

View File

@ -1,6 +1,4 @@
import pytest from unittest.mock import patch
from unittest.mock import patch, MagicMock
import argparse
from aider_gitea.__main__ import parse_args from aider_gitea.__main__ import parse_args
@ -8,11 +6,16 @@ from aider_gitea.__main__ import parse_args
def test_parse_args_with_reviewers_and_assignees(): def test_parse_args_with_reviewers_and_assignees():
"""Test that reviewers and assignees arguments are correctly parsed.""" """Test that reviewers and assignees arguments are correctly parsed."""
test_args = [ test_args = [
'--gitea-url', 'https://gitea.example.com', '--gitea-url',
'--owner', 'test-owner', 'https://gitea.example.com',
'--repo', 'test-repo', '--owner',
'--reviewers', 'user1,user2', 'test-owner',
'--assignees', 'user3,user4' '--repo',
'test-repo',
'--reviewers',
'user1,user2',
'--assignees',
'user3,user4',
] ]
with patch('sys.argv', ['aider_gitea'] + test_args): with patch('sys.argv', ['aider_gitea'] + test_args):
@ -28,9 +31,12 @@ def test_parse_args_with_reviewers_and_assignees():
def test_parse_args_without_reviewers_and_assignees(): def test_parse_args_without_reviewers_and_assignees():
"""Test that the parser works without reviewers and assignees.""" """Test that the parser works without reviewers and assignees."""
test_args = [ test_args = [
'--gitea-url', 'https://gitea.example.com', '--gitea-url',
'--owner', 'test-owner', 'https://gitea.example.com',
'--repo', 'test-repo' '--owner',
'test-owner',
'--repo',
'test-repo',
] ]
with patch('sys.argv', ['aider_gitea'] + test_args): with patch('sys.argv', ['aider_gitea'] + test_args):