Beispiel #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)
Beispiel #2
0
def test_should_return_correct_details_for_temporary_failure():
    get_mmg_responses('4') == 'temporary-failure'
Beispiel #3
0
def test_should_return_correct_details_for_bounced(status):
    get_mmg_responses(status) == 'permanent-failure'
Beispiel #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']
Beispiel #5
0
def test_should_return_correct_details_for_delivery():
    get_mmg_responses('3') == 'delivered'
Beispiel #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']
Beispiel #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']
Beispiel #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
Beispiel #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
Beispiel #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