mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Update tests
This commit is contained in:
parent
ffb0cdf88f
commit
d2d4f337fb
16 changed files with 170 additions and 40 deletions
|
|
@ -8,7 +8,9 @@ from tests.mocked_bot import MockedBot
|
||||||
class TestGetFile:
|
class TestGetFile:
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_method(self, bot: MockedBot):
|
async def test_method(self, bot: MockedBot):
|
||||||
prepare_result = bot.add_result_for(GetFile, ok=True, result=File(file_id="file id"))
|
prepare_result = bot.add_result_for(
|
||||||
|
GetFile, ok=True, result=File(file_id="file id", file_unique_id="file id")
|
||||||
|
)
|
||||||
|
|
||||||
response: File = await GetFile(file_id="file id")
|
response: File = await GetFile(file_id="file id")
|
||||||
request: Request = bot.get_request()
|
request: Request = bot.get_request()
|
||||||
|
|
@ -17,7 +19,9 @@ class TestGetFile:
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_bot_method(self, bot: MockedBot):
|
async def test_bot_method(self, bot: MockedBot):
|
||||||
prepare_result = bot.add_result_for(GetFile, ok=True, result=File(file_id="file id"))
|
prepare_result = bot.add_result_for(
|
||||||
|
GetFile, ok=True, result=File(file_id="file id", file_unique_id="file id")
|
||||||
|
)
|
||||||
|
|
||||||
response: File = await bot.get_file(file_id="file id")
|
response: File = await bot.get_file(file_id="file id")
|
||||||
request: Request = bot.get_request()
|
request: Request = bot.get_request()
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,15 @@ class TestGetStickerSet:
|
||||||
title="test",
|
title="test",
|
||||||
is_animated=False,
|
is_animated=False,
|
||||||
contains_masks=False,
|
contains_masks=False,
|
||||||
stickers=[Sticker(file_id="file if", width=42, height=42, is_animated=False)],
|
stickers=[
|
||||||
|
Sticker(
|
||||||
|
file_id="file if",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
is_animated=False,
|
||||||
|
file_unique_id="file id",
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -35,7 +43,15 @@ class TestGetStickerSet:
|
||||||
title="test",
|
title="test",
|
||||||
is_animated=False,
|
is_animated=False,
|
||||||
contains_masks=False,
|
contains_masks=False,
|
||||||
stickers=[Sticker(file_id="file if", width=42, height=42, is_animated=False)],
|
stickers=[
|
||||||
|
Sticker(
|
||||||
|
file_id="file if",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
is_animated=False,
|
||||||
|
file_unique_id="file id",
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,10 @@ class TestGetUserProfilePhotos:
|
||||||
GetUserProfilePhotos,
|
GetUserProfilePhotos,
|
||||||
ok=True,
|
ok=True,
|
||||||
result=UserProfilePhotos(
|
result=UserProfilePhotos(
|
||||||
total_count=1, photos=[[PhotoSize(file_id="file_id", width=42, height=42)]]
|
total_count=1,
|
||||||
|
photos=[
|
||||||
|
[PhotoSize(file_id="file_id", width=42, height=42, file_unique_id="file id")]
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -27,7 +30,10 @@ class TestGetUserProfilePhotos:
|
||||||
GetUserProfilePhotos,
|
GetUserProfilePhotos,
|
||||||
ok=True,
|
ok=True,
|
||||||
result=UserProfilePhotos(
|
result=UserProfilePhotos(
|
||||||
total_count=1, photos=[[PhotoSize(file_id="file_id", width=42, height=42)]]
|
total_count=1,
|
||||||
|
photos=[
|
||||||
|
[PhotoSize(file_id="file_id", width=42, height=42, file_unique_id="file id")]
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ class TestSendAnimation:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
animation=Animation(file_id="file id", width=42, height=42, duration=0),
|
animation=Animation(
|
||||||
|
file_id="file id", width=42, height=42, duration=0, file_unique_id="file id"
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +36,9 @@ class TestSendAnimation:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
animation=Animation(file_id="file id", width=42, height=42, duration=0),
|
animation=Animation(
|
||||||
|
file_id="file id", width=42, height=42, duration=0, file_unique_id="file id"
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class TestSendAudio:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
audio=Audio(file_id="file id", duration=42),
|
audio=Audio(file_id="file id", duration=42, file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +34,7 @@ class TestSendAudio:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
audio=Audio(file_id="file id", duration=42),
|
audio=Audio(file_id="file id", duration=42, file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class TestSendDocument:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
document=Document(file_id="file id"),
|
document=Document(file_id="file id", file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +34,7 @@ class TestSendDocument:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
document=Document(file_id="file id"),
|
document=Document(file_id="file id", file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,9 @@ class TestSendGame:
|
||||||
game=Game(
|
game=Game(
|
||||||
title="title",
|
title="title",
|
||||||
description="description",
|
description="description",
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")
|
||||||
|
],
|
||||||
),
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
|
|
@ -41,7 +43,9 @@ class TestSendGame:
|
||||||
game=Game(
|
game=Game(
|
||||||
title="title",
|
title="title",
|
||||||
description="description",
|
description="description",
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")
|
||||||
|
],
|
||||||
),
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -26,14 +26,22 @@ class TestSendMediaGroup:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")
|
||||||
|
],
|
||||||
media_group_id="media group",
|
media_group_id="media group",
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
message_id=43,
|
message_id=43,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video=Video(file_id="file id", width=42, height=42, duration=0),
|
video=Video(
|
||||||
|
file_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
duration=0,
|
||||||
|
file_unique_id="file id",
|
||||||
|
),
|
||||||
media_group_id="media group",
|
media_group_id="media group",
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
|
|
@ -60,14 +68,22 @@ class TestSendMediaGroup:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")
|
||||||
|
],
|
||||||
media_group_id="media group",
|
media_group_id="media group",
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
Message(
|
Message(
|
||||||
message_id=43,
|
message_id=43,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video=Video(file_id="file id", width=42, height=42, duration=0),
|
video=Video(
|
||||||
|
file_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
duration=0,
|
||||||
|
file_unique_id="file id",
|
||||||
|
),
|
||||||
media_group_id="media group",
|
media_group_id="media group",
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ class TestSendPhoto:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")
|
||||||
|
],
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +36,9 @@ class TestSendPhoto:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", width=42, height=42, file_unique_id="file id")
|
||||||
|
],
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,13 @@ class TestSendSticker:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
sticker=Sticker(file_id="file id", width=42, height=42, is_animated=False),
|
sticker=Sticker(
|
||||||
|
file_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
is_animated=False,
|
||||||
|
file_unique_id="file id",
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +40,13 @@ class TestSendSticker:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
sticker=Sticker(file_id="file id", width=42, height=42, is_animated=False),
|
sticker=Sticker(
|
||||||
|
file_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
is_animated=False,
|
||||||
|
file_unique_id="file id",
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ class TestSendVideo:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video=Video(file_id="file id", width=42, height=42, duration=0),
|
video=Video(
|
||||||
|
file_id="file id", width=42, height=42, duration=0, file_unique_id="file id"
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +36,9 @@ class TestSendVideo:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video=Video(file_id="file id", width=42, height=42, duration=0),
|
video=Video(
|
||||||
|
file_id="file id", width=42, height=42, duration=0, file_unique_id="file id"
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ class TestSendVideoNote:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video_note=VideoNote(file_id="file id", length=0, duration=0),
|
video_note=VideoNote(
|
||||||
|
file_id="file id", length=0, duration=0, file_unique_id="file id"
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -36,7 +38,9 @@ class TestSendVideoNote:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video_note=VideoNote(file_id="file id", length=0, duration=0),
|
video_note=VideoNote(
|
||||||
|
file_id="file id", length=0, duration=0, file_unique_id="file id"
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class TestSendVoice:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
voice=Voice(file_id="file id", duration=0),
|
voice=Voice(file_id="file id", duration=0, file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
@ -34,7 +34,7 @@ class TestSendVoice:
|
||||||
result=Message(
|
result=Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
voice=Voice(file_id="file id", duration=0),
|
voice=Voice(file_id="file id", duration=0, file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from aiogram.api.methods import Request, SetChatAdministratorCustomTitle, SetChatTitle
|
||||||
|
from tests.mocked_bot import MockedBot
|
||||||
|
|
||||||
|
|
||||||
|
class TestSetChatTitle:
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_method(self, bot: MockedBot):
|
||||||
|
prepare_result = bot.add_result_for(SetChatAdministratorCustomTitle, ok=True, result=True)
|
||||||
|
|
||||||
|
response: bool = await SetChatAdministratorCustomTitle(
|
||||||
|
chat_id=-42, user_id=42, custom_title="test chat"
|
||||||
|
)
|
||||||
|
request: Request = bot.get_request()
|
||||||
|
assert request.method == "setChatAdministratorCustomTitle"
|
||||||
|
assert response == prepare_result.result
|
||||||
|
|
||||||
|
@pytest.mark.asyncio
|
||||||
|
async def test_bot_method(self, bot: MockedBot):
|
||||||
|
prepare_result = bot.add_result_for(SetChatAdministratorCustomTitle, ok=True, result=True)
|
||||||
|
|
||||||
|
response: bool = await bot.set_chat_administrator_custom_title(
|
||||||
|
chat_id=-42, user_id=42, custom_title="test chat"
|
||||||
|
)
|
||||||
|
request: Request = bot.get_request()
|
||||||
|
assert request.method == "setChatAdministratorCustomTitle"
|
||||||
|
assert response == prepare_result.result
|
||||||
|
|
@ -9,7 +9,7 @@ class TestUploadStickerFile:
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_method(self, bot: MockedBot):
|
async def test_method(self, bot: MockedBot):
|
||||||
prepare_result = bot.add_result_for(
|
prepare_result = bot.add_result_for(
|
||||||
UploadStickerFile, ok=True, result=File(file_id="file id")
|
UploadStickerFile, ok=True, result=File(file_id="file id", file_unique_id="file id")
|
||||||
)
|
)
|
||||||
|
|
||||||
response: File = await UploadStickerFile(
|
response: File = await UploadStickerFile(
|
||||||
|
|
@ -22,7 +22,7 @@ class TestUploadStickerFile:
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_bot_method(self, bot: MockedBot):
|
async def test_bot_method(self, bot: MockedBot):
|
||||||
prepare_result = bot.add_result_for(
|
prepare_result = bot.add_result_for(
|
||||||
UploadStickerFile, ok=True, result=File(file_id="file id")
|
UploadStickerFile, ok=True, result=File(file_id="file id", file_unique_id="file id")
|
||||||
)
|
)
|
||||||
|
|
||||||
response: File = await bot.upload_sticker_file(
|
response: File = await bot.upload_sticker_file(
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
audio=Audio(file_id="file id", duration=42),
|
audio=Audio(file_id="file id", file_unique_id="file id", duration=42),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -55,7 +55,13 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
animation=Animation(file_id="file id", width=42, height=42, duration=0),
|
animation=Animation(
|
||||||
|
file_id="file id",
|
||||||
|
file_unique_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
duration=0,
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -65,7 +71,7 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
document=Document(file_id="file id"),
|
document=Document(file_id="file id", file_unique_id="file id"),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -78,7 +84,11 @@ class TestMessage:
|
||||||
game=Game(
|
game=Game(
|
||||||
title="title",
|
title="title",
|
||||||
description="description",
|
description="description",
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(
|
||||||
|
file_id="file id", file_unique_id="file id", width=42, height=42
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
|
|
@ -89,7 +99,9 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
photo=[
|
||||||
|
PhotoSize(file_id="file id", file_unique_id="file id", width=42, height=42)
|
||||||
|
],
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -99,7 +111,13 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
sticker=Sticker(file_id="file id", width=42, height=42, is_animated=False),
|
sticker=Sticker(
|
||||||
|
file_id="file id",
|
||||||
|
file_unique_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
is_animated=False,
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -109,7 +127,13 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video=Video(file_id="file id", width=42, height=42, duration=0),
|
video=Video(
|
||||||
|
file_id="file id",
|
||||||
|
file_unique_id="file id",
|
||||||
|
width=42,
|
||||||
|
height=42,
|
||||||
|
duration=0,
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -119,7 +143,9 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
video_note=VideoNote(file_id="file id", length=0, duration=0),
|
video_note=VideoNote(
|
||||||
|
file_id="file id", file_unique_id="file id", length=0, duration=0
|
||||||
|
),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -129,7 +155,7 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
voice=Voice(file_id="file id", duration=0),
|
voice=Voice(file_id="file id", file_unique_id="file id", duration=0),
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
@ -282,7 +308,9 @@ class TestMessage:
|
||||||
Message(
|
Message(
|
||||||
message_id=42,
|
message_id=42,
|
||||||
date=datetime.datetime.now(),
|
date=datetime.datetime.now(),
|
||||||
new_chat_photo=[PhotoSize(file_id="file id", width=42, height=42)],
|
new_chat_photo=[
|
||||||
|
PhotoSize(file_id="file id", file_unique_id="file id", width=42, height=42)
|
||||||
|
],
|
||||||
chat=Chat(id=42, type="private"),
|
chat=Chat(id=42, type="private"),
|
||||||
from_user=User(id=42, is_bot=False, first_name="Test"),
|
from_user=User(id=42, is_bot=False, first_name="Test"),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue