Пример #1
0
def test_send_attach_str_with_params(get_token: str, get_chat_id: int,
                                     param: t.Dict):
    """Проверка отправки файла"""
    test_name = inspect.currentframe().f_code.co_name
    client = Telegram(token=get_token, chat_id=get_chat_id)

    client.send_attach(f"test send str attach. {test_name}", **param)
Пример #2
0
def test_send_message(get_token: str, get_chat_id: int):
    """Базовая отправка сообщения"""
    test_name = inspect.currentframe().f_code.co_name
    msg = f"test base send_message. with link preview https://github.com {test_name}"

    client = Telegram(token=get_token, chat_id=get_chat_id)
    client.send_message(msg)
Пример #3
0
def test_send_message_two_chat_ids(get_token: str, get_chat_id: int):
    """Отправка базового сообщения в два чата"""
    test_name = inspect.currentframe().f_code.co_name
    msg = f"test two chat_ids(2 msg to one chat id) send message. {test_name}"

    two_tokens = [get_chat_id, get_chat_id]
    client = Telegram(token=get_token, chat_id=two_tokens)
    client.send_message(msg)
Пример #4
0
def test_send_message_with_params(get_token: str, get_chat_id: int,
                                  param: t.Dict):
    """Отправка сообщения с параметрами"""
    test_name = inspect.currentframe().f_code.co_name
    msg = f"{param=}\ntest send message with param.\n{test_name} https://github.com/"

    client = Telegram(token=get_token, chat_id=get_chat_id)
    client.send_message(msg, **param)
Пример #5
0
def test_send_attach_str_two_chat_ids(get_token: str, get_chat_id: int):
    """Проверка отправки файла"""
    test_name = inspect.currentframe().f_code.co_name
    client = Telegram(token=get_token, chat_id=[get_chat_id, get_chat_id])

    client.send_attach(f"test send str attach. {test_name}")