コード例 #1
0
def test_execute_for_all_repos(
    mock_config_manager: MockerFixture,
    mock_github_service: MockerFixture,
    domain_prs: List[pr.PullRequest],
) -> None:
    """It returns success."""
    config_manager = mock_config_manager.return_value
    github_service = mock_github_service.return_value
    request = domain_prs[0]
    response = ghcp.GhCreatePrUseCase(config_manager, github_service).execute(
        request, REQUEST_ISSUES
    )

    assert bool(response) is True
    assert "success message\nsuccess message\n" == response.value
コード例 #2
0
def test_execute_link_issue(
    mock_config_manager: MockerFixture,
    mock_github_service: MockerFixture,
    mock_gh_list_issue_use_case: MockerFixture,
    domain_prs: List[pr.PullRequest],
) -> None:
    """It returns success."""
    config_manager = mock_config_manager.return_value
    github_service = mock_github_service.return_value
    mock_gh_list_issue_use_case.return_value.execute.return_value = (
        res.ResponseSuccess()
    )
    request = domain_prs[1]
    response = ghcp.GhCreatePrUseCase(config_manager, github_service).execute(
        request, REQUEST_ISSUES
    )

    assert bool(response) is True
    assert "success message\nsuccess message\n" == response.value
コード例 #3
0
def test_execute_link_issue_failed_for_specific_repo(
    mock_config_manager: MockerFixture,
    mock_github_service: MockerFixture,
    mock_gh_list_issue_use_case: MockerFixture,
    domain_prs: List[pr.PullRequest],
) -> None:
    """It returns success."""
    config_manager = mock_config_manager.return_value
    github_service = mock_github_service.return_value
    mock_gh_list_issue_use_case.return_value.execute.return_value = res.ResponseFailure(
        res.ResponseTypes.PARAMETERS_ERROR, "msg"
    )
    request = domain_prs[1]
    response = ghcp.GhCreatePrUseCase(config_manager, github_service).execute(
        request, REQUEST_ISSUES, "staticdev/omg"
    )

    assert bool(response) is True
    assert "success message\n" == response.value