aider-gitea/test/test_assignee_reviewer_cli.py
Jon Michael Aanes 66b2da8461
Some checks failed
Run Python tests (through Pytest) / Test (push) Failing after 25s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 23s
Ruff after Claude Code
2025-06-09 13:48:50 +02:00

75 lines
2.1 KiB
Python

from unittest.mock import patch
from aider_gitea import RepositoryConfig
from aider_gitea.__main__ import parse_args
class TestAssigneeReviewerCLI:
@patch(
'sys.argv',
[
'aider_gitea',
'--gitea-url',
'https://gitea.example.com',
'--owner',
'testowner',
'--aider-model',
'claude-3-sonnet',
'--assignee',
'john_doe',
'--reviewer',
'jane_smith',
],
)
def test_parse_args_with_assignee_and_reviewer(self):
"""Test that CLI arguments for assignee and reviewer are parsed correctly."""
args = parse_args()
assert args.assignee == 'john_doe'
assert args.reviewer == 'jane_smith'
@patch(
'sys.argv',
[
'aider_gitea',
'--gitea-url',
'https://gitea.example.com',
'--owner',
'testowner',
'--aider-model',
'claude-3-sonnet',
],
)
def test_parse_args_without_assignee_and_reviewer(self):
"""Test that assignee and reviewer default to None when not provided."""
args = parse_args()
assert args.assignee is None
assert args.reviewer is None
def test_repository_config_with_assignee_and_reviewer(self):
"""Test that RepositoryConfig stores assignee and reviewer correctly."""
config = RepositoryConfig(
gitea_url='https://gitea.example.com',
owner='testowner',
repo='testrepo',
base_branch='main',
assignee='john_doe',
reviewer='jane_smith',
)
assert config.assignee == 'john_doe'
assert config.reviewer == 'jane_smith'
def test_repository_config_without_assignee_and_reviewer(self):
"""Test that RepositoryConfig defaults assignee and reviewer to None."""
config = RepositoryConfig(
gitea_url='https://gitea.example.com',
owner='testowner',
repo='testrepo',
base_branch='main',
)
assert config.assignee is None
assert config.reviewer is None