コード例 #1
0
def test_should_be_raise_if_unrecognised_status_code():
    with pytest.raises(KeyError) as e:
        get_mmg_responses('99')
    assert '99' in str(e.value)
コード例 #2
0
def test_should_return_correct_details_for_temporary_failure():
    get_mmg_responses('4') == 'temporary-failure'
コード例 #3
0
def test_should_return_correct_details_for_bounced(status):
    get_mmg_responses(status) == 'permanent-failure'
コード例 #4
0
def test_should_be_none_if_unrecognised_status_code():
    response_dict = get_mmg_responses('blah')
    assert response_dict['message'] == 'Declined'
    assert response_dict['notification_status'] == 'failed'
    assert response_dict['notification_statistics_status'] == 'failure'
    assert not response_dict['success']
コード例 #5
0
def test_should_return_correct_details_for_delivery():
    get_mmg_responses('3') == 'delivered'
コード例 #6
0
def test_should_return_correct_details_for_bounced():
    response_dict = get_mmg_responses('50')
    assert response_dict['message'] == 'Declined'
    assert response_dict['notification_status'] == 'failed'
    assert response_dict['notification_statistics_status'] == 'failure'
    assert not response_dict['success']
コード例 #7
0
def test_should_return_correct_details_for_delivery():
    response_dict = get_mmg_responses('3')
    assert response_dict['message'] == 'Delivered'
    assert response_dict['notification_status'] == 'delivered'
    assert response_dict['notification_statistics_status'] == 'delivered'
    assert response_dict['success']
コード例 #8
0
def test_get_mmg_responses_should_return_correct_details_for_bounced(
        status, detailed_status_code, result):
    assert get_mmg_responses(status, detailed_status_code) == result
コード例 #9
0
def test_get_mmg_responses_should_return_correct_details_for_temporary_failure(
        detailed_status_code, result):
    assert get_mmg_responses('4', detailed_status_code) == result
コード例 #10
0
def test_get_mmg_responses_should_return_correct_details_for_delivery(
        detailed_status_code, result):
    assert get_mmg_responses('3', detailed_status_code) == result