コード例 #1
0
def test_10_downvote_to_upvote():
    merge_request = MergeRequest()
    merge_request.upvote("dev1")
    merge_request.downvote("dev2")
    merge_request.upvote("dev2")

    assert merge_request.status == MergeRequestStatus.APPROVED
コード例 #2
0
def test_12_cannot_vote_on_closed_merge_request():
    merge_request = MergeRequest()
    merge_request.close()
    pytest.raises(MergeRequestException, merge_request.upvote, "dev1")
    with pytest.raises(MergeRequestException,
                       match="can't vote on a closed merge request"):
        merge_request.downvote("dev1")
コード例 #3
0
def test_9_찬성을_반대로_수정한경우_거절():
    merge_request = MergeRequest()
    merge_request.upvote("dev1")
    merge_request.upvote("dev2")
    merge_request.downvote("dev1")

    assert merge_request.status == MergeRequestStatus.REJECTED
コード例 #4
0
def test_12_cannot_vote_on_closed_merge_request():
    merge_request = MergeRequest()
    merge_request.close()
    pytest.raises(MergeRequestException, merge_request.upvote, "dev1")
    with pytest.raises(MergeRequestException,
                       match="CLOSED 상태인 표결에는 merge 할 수 없습니다."):
        merge_request.downvote("dev1")
コード例 #5
0
def test_11_invalid_types():
    merge_request = MergeRequest()
    pytest.raises(TypeError, merge_request.upvote, {"invalid-object"})
コード例 #6
0
def rejected_mr():
    merge_request = MergeRequest()
    merge_request.downvote("dev1")
    return merge_request
コード例 #7
0
def test_8_찬성1_중복투표_보류():
    merge_request = MergeRequest()
    merge_request.upvote("dev1")
    merge_request.upvote("dev1")

    assert merge_request.status == MergeRequestStatus.PENDING
コード例 #8
0
def test_7_찬성2_승인():
    merge_request = MergeRequest()
    merge_request.upvote("dev1")
    merge_request.upvote("dev2")

    assert merge_request.status == MergeRequestStatus.APPROVED
コード例 #9
0
def test_6_찬성_1이면_보류한다():
    merge_request = MergeRequest()
    merge_request.upvote("core-dev")
    assert merge_request.status == MergeRequestStatus.PENDING
コード例 #10
0
def test_5_표결이_없으면_보류한다():
    assert MergeRequest().status == MergeRequestStatus.PENDING