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