コード例 #1
0
def test_success_msg_pass():
    state = prepare_state("")
    success_msg(state, "NEW SUCCESS MSG")

    sct_payload = state.reporter.build_final_payload()
    assert sct_payload['correct'] == True
    assert sct_payload['message'] == "NEW SUCCESS MSG"
コード例 #2
0
def test_success_msg_fail():
    state = prepare_state("")
    child = success_msg(state, "NEW SUCCESS MSG")
    with pytest.raises(TF):
        fail(child)

    sct_payload = state.reporter.build_payload()
    assert sct_payload['message'] != "NEW SUCCESS MSG"