コード例 #1
0
ファイル: test_whatsapp.py プロジェクト: nitayv9/calendar
def test_no_number():
    # Redirects to whatsapp window. Choose someone from your own contact list.
    phone_number = ""
    message = 'Which phone number?'
    assert whatsapp.make_link(phone_number, message) == {
        "link": "https://api.whatsapp.com/send?phone=&text=Which+phone+"
        "number%3F"}
コード例 #2
0
ファイル: test_whatsapp.py プロジェクト: nitayv9/calendar
def test_wrong_phone_number():
    # Redirects you to a popup: The phone number shared via a link is incorrect
    phone_number = "999999"
    message = 'Wrong phone number?'
    assert whatsapp.make_link(phone_number, message) == {
        "link": "https://api.whatsapp.com/send?phone=999999&text=Wrong+phone+"
        "number%3F"}
コード例 #3
0
ファイル: test_whatsapp.py プロジェクト: nitayv9/calendar
def test_whatsapp_send():
    # Redirects you directly to the specified contact and the message will
    #  already be there (or to whatsapp web if the call is from the web)
    phone_number = "972536106106"
    message = 'Event or a joke or the schedule of one day'
    assert whatsapp.make_link(phone_number, message) == {
        "link": "https://api.whatsapp.com/send?phone=972536106106&text=Event+"
        "or+a+joke+or+the+schedule+of+one+day"}
コード例 #4
0
def test_no_number():
    """Test with no phone number and valid text.

    Redirects to WhatsApp window. Choose someone from your own contact list.

    """
    phone_number = ""
    message = 'Hello hello'
    expected = "https://api.whatsapp.com/send?phone=&text=Hello+hello"
    assert whatsapp.make_link(phone_number, message) == expected
コード例 #5
0
def test_no_message():
    """Test with valid phone number and no text.

    Redirects to WhatsApp of the specified number. Write your own message.

    """
    phone_number = "972536106106"
    message = ''
    expected = "https://api.whatsapp.com/send?phone=972536106106&text="
    assert whatsapp.make_link(phone_number, message) == expected
コード例 #6
0
def test_wrong_phone_number():
    """Text with invalid phone number and valid text.

    Redirects you to a popup: The phone number shared via a link is incorrect.

    """
    phone_number = "999999"
    message = 'Hello hello'
    expected = "https://api.whatsapp.com/send?phone=999999&text=Hello+hello"
    assert whatsapp.make_link(phone_number, message) == expected
コード例 #7
0
def test_whatsapp_send():
    """Test with a valid phone number and text.

    Redirects directly to the specified contact and the message will
    already be there (or to WhatsApp Web if the call is from the web).

    """
    phone_number = "972536106106"
    message = 'Hello hello'
    expected = ("https://api.whatsapp.com/send?phone=972536106106&text="
                "Hello+hello")
    assert whatsapp.make_link(phone_number, message) == expected
コード例 #8
0
ファイル: test_whatsapp.py プロジェクト: nitayv9/calendar
def test_no_message():
    # Redirects to whatsapp of the specified number. Write your own message.
    phone_number = "972536106106"
    message = ''
    assert whatsapp.make_link(phone_number, message) == {
        "link": "https://api.whatsapp.com/send?phone=972536106106&text="}