def test_load_repository_info(mock_repo_info): """Test that load_repository_info() works for both SSH and HTTPS URLs.""" repo = utils.load_repository_info() assert repo.owner == "pytest-dev" assert repo.name == "pytest" assert mock_repo_info.called
def default_repo(labels_context: LabelsContext) -> str: """Load repository name information from the local working tree.""" if labels_context.repository is None: repository = utils.load_repository_info() if repository is None: raise click.BadParameter( "Unable to read repository name from git remote URL.") labels_context.repository = repository return labels_context.repository.name
def test_load_repository_bad_url(mock_repo_info_bad_url): """Test that load_repository_info() handles bad URLs.""" repo = utils.load_repository_info() assert repo is None assert mock_repo_info_bad_url.called
def test_load_repository_info_error(mock_repo_info_error): """Test that load_repository_info() handles errors.""" repo = utils.load_repository_info() assert repo is None assert mock_repo_info_error.called