aider-gitea/test/test_main_args.py
Jon Michael Aanes 1371343ff4
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 25s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 22s
Ruff after aider
2025-04-15 23:41:22 +02:00

50 lines
1.3 KiB
Python

from unittest.mock import patch
from aider_gitea.__main__ import parse_args
def test_parse_args_with_reviewers_and_assignees():
"""Test that reviewers and assignees arguments are correctly parsed."""
test_args = [
'--gitea-url',
'https://gitea.example.com',
'--owner',
'test-owner',
'--repo',
'test-repo',
'--reviewers',
'user1,user2',
'--assignees',
'user3,user4',
]
with patch('sys.argv', ['aider_gitea'] + test_args):
args = parse_args()
assert args.gitea_url == 'https://gitea.example.com'
assert args.owner == 'test-owner'
assert args.repo == 'test-repo'
assert args.reviewers == 'user1,user2'
assert args.assignees == 'user3,user4'
def test_parse_args_without_reviewers_and_assignees():
"""Test that the parser works without reviewers and assignees."""
test_args = [
'--gitea-url',
'https://gitea.example.com',
'--owner',
'test-owner',
'--repo',
'test-repo',
]
with patch('sys.argv', ['aider_gitea'] + test_args):
args = parse_args()
assert args.gitea_url == 'https://gitea.example.com'
assert args.owner == 'test-owner'
assert args.repo == 'test-repo'
assert args.reviewers is None
assert args.assignees is None