1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Implemented some tests

This commit is contained in:
coder2020official 2022-06-21 15:28:01 +05:00
parent d7f34ae370
commit a7fb8a2bec

View File

@ -6,10 +6,13 @@ from telebot import types
def test_json_user():
jsonstring = r'{"id":101176298,"first_name":"RDSSBOT","last_name":")))","username":"rdss_bot","is_bot":true}'
jsonstring = r'{"id":101176298,"first_name":"RDSSBOT","last_name":")))","username":"rdss_bot","is_bot":true, "is_premium":true, "added_to_attachment_menu": true}'
u = types.User.de_json(jsonstring)
assert u.id == 101176298
assert u.full_name == 'RDSSBOT )))'
assert u.is_premium is True
assert u.added_to_attachment_menu is True
def test_json_message():
@ -155,11 +158,13 @@ def test_json_update():
def test_json_chat():
json_string = r'{"id": -111111,"title": "Test Title","type": "group"}'
json_string = r'{"id": -111111,"title": "Test Title","type": "group", "join_to_send_messages": true, "join_by_request": true}'
chat = types.Chat.de_json(json_string)
assert chat.id == -111111
assert chat.type == 'group'
assert chat.title == 'Test Title'
assert chat.join_to_send_messages is True
assert chat.join_by_request is True
def test_InlineQueryResultCachedPhoto():