Beispiel #1
0
def test_send_text_to_valid_phone_number() -> None:
    payload = {}
    payload['account_sid'] = twilio_account_sid
    payload['auth_token'] = twilio_auth_token
    payload['from'] = twilio_from
    payload['alert'] = 'hello I am an alert!'
    recipiant = "+15005550006"
    results = send_text(recipiant, payload)
    assert results.account_sid == twilio_account_sid
Beispiel #2
0
def test_send_text_from_invalid_phone_number() -> None:
    '''testing for https://www.twilio.com/docs/api/errors/21212 '''
    payload = {}
    payload['account_sid'] = twilio_account_sid
    payload['auth_token'] = twilio_auth_token
    payload['from'] = "+15005550001"
    payload['alert'] = 'hello I am an alert!'
    recipiant = "+15005550006"
    results = send_text(recipiant, payload)
    assert results['code'] == 21212
    assert results['error'] == "Text not sent"
Beispiel #3
0
def test_send_text_blocked_phone_number_from_your_accnt() -> None:
    '''testting for https://www.twilio.com/docs/api/errors/21610 '''
    payload = {}
    payload['account_sid'] = twilio_account_sid
    payload['auth_token'] = twilio_auth_token
    payload['from'] = twilio_from
    payload['alert'] = 'hello I am an alert!'
    recipiant = "+15005550004"

    results = send_text(recipiant, payload)
    assert results['error'] == "Text not sent"
Beispiel #4
0
def test_send_text_number_incaperbale_of_receving_sms() -> None:
    '''testting for https://www.twilio.com/docs/api/errors/21614 '''
    payload = {}
    payload['account_sid'] = twilio_account_sid
    payload['auth_token'] = twilio_auth_token
    payload['from'] = twilio_from
    payload['alert'] = 'hello I am an alert!'
    recipiant = "+15005550009"

    results = send_text(recipiant, payload)
    assert results['error'] == "Text not sent"
Beispiel #5
0
def test_send_text_does_not_have_international_permisions() -> None:
    '''testting for https://www.twilio.com/docs/api/errors/21408 '''
    payload = {}
    payload['account_sid'] = twilio_account_sid
    payload['auth_token'] = twilio_auth_token
    payload['from'] = twilio_from
    payload['alert'] = 'hello I am an alert!'
    recipiant = "+15005550003"

    results = send_text(recipiant, payload)
    assert results['error'] == "Text not sent"