mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Message support contact.
This commit is contained in:
@ -86,4 +86,10 @@ def test_json_UserProfilePhotos():
|
||||
json_string = r'{"total_count":1,"photos":[[{"file_id":"AgADAgADqacxG6wpRwABvEB6fpeIcKS4HAIkAATZH_SpyZjzIwdVAAIC","file_size":6150,"width":160,"height":160},{"file_id":"AgADAgADqacxG6wpRwABvEB6fpeIcKS4HAIkAATOiTNi_YoJMghVAAIC","file_size":13363,"width":320,"height":320},{"file_id":"AgADAgADqacxG6wpRwABvEB6fpeIcKS4HAIkAAQW4DyFv0-lhglVAAIC","file_size":28347,"width":640,"height":640},{"file_id":"AgADAgADqacxG6wpRwABvEB6fpeIcKS4HAIkAAT50RvJCg0GQApVAAIC","file_size":33953,"width":800,"height":800}]]}'
|
||||
upp = types.UserProfilePhotos.de_json(json_string)
|
||||
assert upp.photos[0][0].width == 160
|
||||
assert upp.photos[0][-1].height == 800
|
||||
assert upp.photos[0][-1].height == 800
|
||||
|
||||
def test_json_contact():
|
||||
json_string = r'{"phone_number":"00011111111","first_name":"dd","last_name":"ddl","user_id":8633}'
|
||||
contact = types.Contact.de_json(json_string)
|
||||
assert contact.first_name == 'dd'
|
||||
assert contact.last_name == 'ddl'
|
Reference in New Issue
Block a user