def test_should_be_none_if_unrecognised_status_code(): with pytest.raises(KeyError) as e: get_firetext_responses('99') assert '99' in str(e.value)
def test_should_return_correct_details_for_complaint(): get_firetext_responses('2') == 'pending'
def test_should_return_correct_details_for_bounced(): get_firetext_responses('1') == 'permanent-failure'
def test_should_return_correct_details_for_delivery(): get_firetext_responses('0') == 'delivered'
def test_get_firetext_responses_should_return_correct_details_for_complaint(): assert get_firetext_responses('2') == ('pending', None)
def test_get_firetext_responses_should_return_correct_details_for_bounced( detailed_status_code, result): assert get_firetext_responses('1', detailed_status_code) == result