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:
parent
d7f34ae370
commit
a7fb8a2bec
@ -6,10 +6,13 @@ from telebot import types
|
|||||||
|
|
||||||
|
|
||||||
def test_json_user():
|
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)
|
u = types.User.de_json(jsonstring)
|
||||||
assert u.id == 101176298
|
assert u.id == 101176298
|
||||||
assert u.full_name == 'RDSSBOT )))'
|
assert u.full_name == 'RDSSBOT )))'
|
||||||
|
assert u.is_premium is True
|
||||||
|
assert u.added_to_attachment_menu is True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_json_message():
|
def test_json_message():
|
||||||
@ -155,11 +158,13 @@ def test_json_update():
|
|||||||
|
|
||||||
|
|
||||||
def test_json_chat():
|
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)
|
chat = types.Chat.de_json(json_string)
|
||||||
assert chat.id == -111111
|
assert chat.id == -111111
|
||||||
assert chat.type == 'group'
|
assert chat.type == 'group'
|
||||||
assert chat.title == 'Test Title'
|
assert chat.title == 'Test Title'
|
||||||
|
assert chat.join_to_send_messages is True
|
||||||
|
assert chat.join_by_request is True
|
||||||
|
|
||||||
|
|
||||||
def test_InlineQueryResultCachedPhoto():
|
def test_InlineQueryResultCachedPhoto():
|
||||||
|
Loading…
Reference in New Issue
Block a user