idk what's this (a lot of time ago)

This commit is contained in:
zemf4you 2024-08-22 09:59:38 +07:00
parent 7bd8f64630
commit fa1b891386
187 changed files with 914 additions and 915 deletions

View file

@ -10,7 +10,7 @@ from aiogram.fsm.storage.memory import (
MemoryStorage,
SimpleEventIsolation,
)
from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage
from aiogram.fsm.storage.redis import RedisStorage
from tests.mocked_bot import MockedBot
DATA_DIR = Path(__file__).parent / "data"

View file

@ -1,68 +1,42 @@
import sys
import pytest
from pydantic import ValidationError
from aiogram.client.default import Default, DefaultBotProperties
from aiogram.client.default import DefaultBotProperties
from aiogram.default_annotations import DefaultLinkPreviewOptions, DefaultParseMode
from aiogram.enums import ParseMode
from aiogram.types import LinkPreviewOptions
from aiogram.types import LinkPreviewOptions, TelegramObject
from tests.mocked_bot import MockedBot
class TestDefault:
def test_init(self):
default = Default("test")
assert default._name == "test"
def test_default_validation(self):
class TestObject(TelegramObject):
parse_mode: DefaultParseMode = None
def test_name_property(self):
default = Default("test")
assert default.name == "test"
obj1 = TestObject()
assert obj1.parse_mode is None
obj2 = TestObject(parse_mode=ParseMode.HTML)
assert obj2.parse_mode == ParseMode.HTML
obj3 = TestObject(parse_mode="HTML")
assert obj3.parse_mode == ParseMode.HTML
with pytest.raises(ValidationError):
TestObject(parse_mode=b"some invalid type")
def test_str(self):
default = Default("test")
assert str(default) == "Default('test')"
def test_remain_value_after_dump_roundtrip(self):
bot = MockedBot(default=DefaultBotProperties())
def test_repr(self):
default = Default("test")
assert repr(default) == "<Default('test')>"
def test_link_preview_options_defined(self):
class TestObject(TelegramObject):
options: DefaultLinkPreviewOptions = None
# won't raise error
TestObject(options=LinkPreviewOptions())
class TestDefaultBotProperties:
def test_post_init_empty(self):
def test_is_empty(self):
default_bot_properties = DefaultBotProperties()
assert default_bot_properties.is_empty
assert default_bot_properties.link_preview is None
def test_post_init_auto_fill_link_preview(self):
default_bot_properties = DefaultBotProperties(
link_preview_is_disabled=True,
link_preview_prefer_small_media=True,
link_preview_prefer_large_media=True,
link_preview_show_above_text=True,
)
assert default_bot_properties.link_preview == LinkPreviewOptions(
is_disabled=True,
prefer_small_media=True,
prefer_large_media=True,
show_above_text=True,
)
def test_getitem(self):
default_bot_properties = DefaultBotProperties(
parse_mode=ParseMode.HTML,
link_preview_is_disabled=True,
link_preview_prefer_small_media=True,
link_preview_prefer_large_media=True,
link_preview_show_above_text=True,
)
assert default_bot_properties["parse_mode"] == ParseMode.HTML
assert default_bot_properties["link_preview_is_disabled"] is True
assert default_bot_properties["link_preview_prefer_small_media"] is True
assert default_bot_properties["link_preview_prefer_large_media"] is True
assert default_bot_properties["link_preview_show_above_text"] is True
@pytest.mark.skipif(sys.version_info < (3, 12), reason="requires python3.11 or higher")
def test_dataclass_creation_3_10_plus(self):
params = DefaultBotProperties.__dataclass_params__
assert params.slots is True
assert params.kw_only is True
default_bot_properties = DefaultBotProperties(protect_content=True)
assert not default_bot_properties.is_empty

View file

@ -16,9 +16,9 @@ from aiohttp import ClientError
from aresponses import ResponsesMockServer
from aiogram import Bot
from aiogram.client.default import Default
from aiogram.client.session import aiohttp
from aiogram.client.session.aiohttp import AiohttpSession
from aiogram.default_annotations import DefaultParseMode
from aiogram.exceptions import TelegramNetworkError
from aiogram.methods import TelegramMethod
from aiogram.types import (
@ -121,7 +121,7 @@ class TestAiohttpSession:
str_: str
int_: int
bool_: bool
unset_: Union[str, Default] = Default("parse_mode")
unset_: DefaultParseMode = None
null_: None
list_: List[str]
dict_: Dict[str, Any]
@ -133,7 +133,6 @@ class TestAiohttpSession:
str_="value",
int_=42,
bool_=True,
unset_=Default("parse_mode"),
null_=None,
list_=["foo"],
dict_={"bar": "baz"},

View file

@ -1,17 +1,16 @@
import datetime
import json
from typing import Any, AsyncContextManager, AsyncGenerator, Dict, Optional, Union
from typing import Any, AsyncContextManager, AsyncGenerator, Dict, Optional
from unittest.mock import AsyncMock, patch
import pytest
from pytz import utc
from aiogram import Bot
from aiogram.client.default import Default, DefaultBotProperties
from aiogram.client.form import form_serialize
from aiogram.client.form import serialize_form_value
from aiogram.client.session.base import BaseSession, TelegramType
from aiogram.client.telegram import PRODUCTION, TelegramAPIServer
from aiogram.enums import ChatType, ParseMode, TopicIconColor
from aiogram.enums import ChatType, TopicIconColor
from aiogram.exceptions import (
ClientDecodeError,
RestartingTelegram,
@ -27,18 +26,8 @@ from aiogram.exceptions import (
TelegramUnauthorizedError,
)
from aiogram.methods import DeleteMessage, GetMe, TelegramMethod
from aiogram.types import (
UNSET_PARSE_MODE,
DateTime,
InputFile,
LinkPreviewOptions,
User,
)
from aiogram.types.base import (
UNSET_DISABLE_WEB_PAGE_PREVIEW,
UNSET_PROTECT_CONTENT,
TelegramObject,
)
from aiogram.types import DateTime, LinkPreviewOptions, User
from aiogram.types.base import TelegramObject
from tests.mocked_bot import MockedBot
@ -105,7 +94,6 @@ class TestBaseSession:
@pytest.mark.parametrize(
"value,result",
[
[None, ...],
["text", "text"],
[ChatType.PRIVATE, "private"],
[TopicIconColor.RED, "16478047"],
@ -123,56 +111,23 @@ class TestBaseSession:
"1494994302",
],
[LinkPreviewOptions(is_disabled=True), '{"is_disabled":true}'],
[Default("parse_mode"), "HTML"],
[Default("protect_content"), "true"],
[Default("link_preview_is_disabled"), "true"],
],
)
def test_form_serialize(self, value: Any, result: str):
bot = MockedBot(
default=DefaultBotProperties(
parse_mode=ParseMode.HTML,
protect_content=True,
link_preview_is_disabled=True,
)
)
def test_serialize_form_value(self, value: Any, result: str):
# TODO: move
# pydantic model roundtrip is needed (DateTime has custom serialization, exclude_none=True)
field_type = type(value)
if issubclass(field_type, (datetime.datetime, datetime.timedelta)):
field_type = DateTime
elif issubclass(field_type, InputFile):
field_type = Union[InputFile, str]
elif issubclass(field_type, Default):
field_type = Optional[Union[Any, Default]]
class TestObject(TelegramObject):
field: field_type
obj = TestObject.model_validate({"field": value}, context={"bot": bot})
serialized_obj = obj.model_dump(mode="json", exclude_none=True)
if value is None:
assert "field" not in serialized_obj
else:
value = serialized_obj["field"]
assert form_serialize(value) == result
obj = TestObject(field=value)
serialized_obj = obj.model_dump(exclude_none=True)
value = serialized_obj["field"]
@pytest.mark.parametrize(
"default",
[
UNSET_PARSE_MODE,
UNSET_DISABLE_WEB_PAGE_PREVIEW,
UNSET_PROTECT_CONTENT,
],
)
def test_default_unset(self, default: Default):
bot = MockedBot()
class TestObject(TelegramObject):
field: Optional[Union[Any, Default]]
obj = TestObject.model_validate({"field": default}, context={"bot": bot})
serialized_obj = obj.model_dump(mode="json")
assert serialized_obj["field"] is None
assert serialize_form_value(value) == result
@pytest.mark.parametrize(
"status_code,content,error",

View file

@ -1,4 +1,4 @@
from aiogram.methods import AnswerCallbackQuery, Request
from aiogram.methods import AnswerCallbackQuery
from tests.mocked_bot import MockedBot

View file

@ -1,11 +1,5 @@
from aiogram import Bot
from aiogram.methods import AnswerInlineQuery, Request
from aiogram.types import (
InlineQueryResult,
InlineQueryResultArticle,
InlineQueryResultPhoto,
InputTextMessageContent,
)
from aiogram.methods import AnswerInlineQuery
from aiogram.types import InlineQueryResultArticle, InputTextMessageContent
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import AnswerPreCheckoutQuery, Request
from aiogram.methods import AnswerPreCheckoutQuery
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import AnswerShippingQuery, Request
from aiogram.methods import AnswerShippingQuery
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import ApproveChatJoinRequest, Request
from aiogram.methods import ApproveChatJoinRequest
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import BanChatMember, Request
from aiogram.methods import BanChatMember
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import BanChatSenderChat, Request
from aiogram.methods import BanChatSenderChat
from tests.mocked_bot import MockedBot

View file

@ -1,11 +1,9 @@
from typing import Any, Dict
from unittest.mock import sentinel
import pytest
from aiogram.client.default import Default
from aiogram.methods import GetMe, SendMessage, TelegramMethod
from aiogram.types import LinkPreviewOptions, TelegramObject, User
from aiogram.methods import GetMe, TelegramMethod
from aiogram.types import TelegramObject, User
from tests.mocked_bot import MockedBot
@ -29,22 +27,24 @@ class TestTelegramMethodRemoveUnset:
class TestTelegramMethodModelDumpJson:
@pytest.mark.parametrize(
"obj",
[
SendMessage(
chat_id=1,
text="test",
),
LinkPreviewOptions(),
],
)
def test_model_dump_json(self, obj):
def has_defaults(dump: Dict[str, Any]) -> bool:
return any(isinstance(value, Default) for value in dump.values())
assert has_defaults(obj.model_dump())
assert not has_defaults(obj.model_dump(mode="json"))
...
# TODO
# @pytest.mark.parametrize(
# "obj",
# [
# SendMessage(
# chat_id=1,
# text="test",
# ),
# LinkPreviewOptions(),
# ],
# )
# def test_model_dump_json(self, obj):
# def has_defaults(dump: Dict[str, Any]) -> bool:
# return any(isinstance(value, Default) for value in dump.values())
#
# assert has_defaults(obj.model_dump())
# assert not has_defaults(obj.model_dump(mode="json"))
class TestTelegramMethodCall:

View file

@ -1,4 +1,4 @@
from aiogram.methods import Close, Request
from aiogram.methods import Close
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import CloseForumTopic, Request
from aiogram.methods import CloseForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import CloseGeneralForumTopic, Request
from aiogram.methods import CloseGeneralForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import CopyMessage, Request
from aiogram.methods import CopyMessage
from aiogram.types import MessageId
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import CreateChatInviteLink, Request
from aiogram.methods import CreateChatInviteLink
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import CreateForumTopic, Request
from aiogram.methods import CreateForumTopic
from aiogram.types import ForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import CreateInvoiceLink, Request
from aiogram.methods import CreateInvoiceLink
from aiogram.types import LabeledPrice
from tests.mocked_bot import MockedBot

View file

@ -1,5 +1,5 @@
from aiogram.enums import StickerFormat
from aiogram.methods import CreateNewStickerSet, Request
from aiogram.methods import CreateNewStickerSet
from aiogram.types import FSInputFile, InputSticker
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeclineChatJoinRequest, Request
from aiogram.methods import DeclineChatJoinRequest
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteChatPhoto, Request
from aiogram.methods import DeleteChatPhoto
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteChatStickerSet, Request
from aiogram.methods import DeleteChatStickerSet
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteForumTopic, Request
from aiogram.methods import DeleteForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteMessage, Request
from aiogram.methods import DeleteMessage
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteMyCommands, Request
from aiogram.methods import DeleteMyCommands
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteStickerFromSet, Request
from aiogram.methods import DeleteStickerFromSet
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteStickerSet, Request
from aiogram.methods import DeleteStickerSet
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import DeleteWebhook, Request
from aiogram.methods import DeleteWebhook
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import EditChatInviteLink, Request
from aiogram.methods import EditChatInviteLink
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import EditForumTopic, Request
from aiogram.methods import EditForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import EditGeneralForumTopic, Request
from aiogram.methods import EditGeneralForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,7 +1,7 @@
import datetime
from typing import Union
from aiogram.methods import EditMessageCaption, Request
from aiogram.methods import EditMessageCaption
from aiogram.types import Chat, Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import Union
from aiogram.methods import EditMessageLiveLocation, Request
from aiogram.methods import EditMessageLiveLocation
from aiogram.types import Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import Union
from aiogram.methods import EditMessageMedia, Request
from aiogram.methods import EditMessageMedia
from aiogram.types import BufferedInputFile, InputMediaPhoto, Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import Union
from aiogram.methods import EditMessageReplyMarkup, Request
from aiogram.methods import EditMessageReplyMarkup
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import Union
from aiogram.methods import EditMessageText, Request
from aiogram.methods import EditMessageText
from aiogram.types import Message
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import ExportChatInviteLink, Request
from aiogram.methods import ExportChatInviteLink
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import ForwardMessage, Request
from aiogram.methods import ForwardMessage
from aiogram.types import Chat, Message
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetChat, Request
from aiogram.methods import GetChat
from aiogram.types import Chat
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import List
from aiogram.methods import GetChatAdministrators, Request
from aiogram.methods import GetChatAdministrators
from aiogram.types import ChatMember, ChatMemberOwner, User
from tests.mocked_bot import MockedBot

View file

@ -1,5 +1,5 @@
from aiogram.methods import GetChatMember, Request
from aiogram.types import ChatMember, ChatMemberOwner, User
from aiogram.methods import GetChatMember
from aiogram.types import ChatMemberOwner, User
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetChatMemberCount, Request
from aiogram.methods import GetChatMemberCount
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetChatMenuButton, Request
from aiogram.methods import GetChatMenuButton
from aiogram.types import MenuButton, MenuButtonDefault
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import List
from aiogram.methods import GetCustomEmojiStickers, Request
from aiogram.methods import GetCustomEmojiStickers
from aiogram.types import Sticker
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetFile, Request
from aiogram.methods import GetFile
from aiogram.types import File
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import List
from aiogram.methods import GetForumTopicIconStickers, Request
from aiogram.methods import GetForumTopicIconStickers
from aiogram.types import Sticker
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import List
from aiogram.methods import GetGameHighScores, Request
from aiogram.methods import GetGameHighScores
from aiogram.types import GameHighScore, User
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetMe, Request
from aiogram.methods import GetMe
from aiogram.types import User
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import List
from aiogram.methods import GetMyCommands, Request
from aiogram.methods import GetMyCommands
from aiogram.types import BotCommand
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetMyDefaultAdministratorRights, Request
from aiogram.methods import GetMyDefaultAdministratorRights
from aiogram.types import ChatAdministratorRights
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetMyDescription, Request
from aiogram.methods import GetMyDescription
from aiogram.types import BotDescription
from tests.mocked_bot import MockedBot

View file

@ -1,5 +1,5 @@
from aiogram.methods import GetMyName
from aiogram.types import BotDescription, BotName
from aiogram.types import BotName
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetMyShortDescription, Request
from aiogram.methods import GetMyShortDescription
from aiogram.types import BotShortDescription
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetStickerSet, Request
from aiogram.methods import GetStickerSet
from aiogram.types import Sticker, StickerSet
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import List
from aiogram.methods import GetUpdates, Request
from aiogram.methods import GetUpdates
from aiogram.types import Update
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetUserProfilePhotos, Request
from aiogram.methods import GetUserProfilePhotos
from aiogram.types import PhotoSize, UserProfilePhotos
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import GetWebhookInfo, Request
from aiogram.methods import GetWebhookInfo
from aiogram.types import WebhookInfo
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import HideGeneralForumTopic, Request
from aiogram.methods import HideGeneralForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import LeaveChat, Request
from aiogram.methods import LeaveChat
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import LogOut, Request
from aiogram.methods import LogOut
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import PinChatMessage, Request
from aiogram.methods import PinChatMessage
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import PromoteChatMember, Request
from aiogram.methods import PromoteChatMember
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import ReopenForumTopic, Request
from aiogram.methods import ReopenForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import ReopenGeneralForumTopic, Request
from aiogram.methods import ReopenGeneralForumTopic
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, RestrictChatMember
from aiogram.methods import RestrictChatMember
from aiogram.types import ChatPermissions
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, RevokeChatInviteLink
from aiogram.methods import RevokeChatInviteLink
from aiogram.types import ChatInviteLink, User
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendAnimation
from aiogram.methods import SendAnimation
from aiogram.types import Animation, Chat, Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendAudio
from aiogram.methods import SendAudio
from aiogram.types import Audio, Chat, Message
from tests.mocked_bot import MockedBot

View file

@ -1,5 +1,5 @@
from aiogram.enums import ChatAction
from aiogram.methods import Request, SendChatAction
from aiogram.methods import SendChatAction
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendContact
from aiogram.methods import SendContact
from aiogram.types import Chat, Contact, Message
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SendDice
from aiogram.methods import SendDice
from aiogram.types import Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendDocument
from aiogram.methods import SendDocument
from aiogram.types import Chat, Document, Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendGame
from aiogram.methods import SendGame
from aiogram.types import Chat, Game, Message, PhotoSize
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendInvoice
from aiogram.methods import SendInvoice
from aiogram.types import Chat, Invoice, LabeledPrice, Message
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendLocation
from aiogram.methods import SendLocation
from aiogram.types import Chat, Location, Message
from tests.mocked_bot import MockedBot

View file

@ -1,7 +1,7 @@
import datetime
from typing import List
from aiogram.methods import Request, SendMediaGroup
from aiogram.methods import SendMediaGroup
from aiogram.types import (
BufferedInputFile,
Chat,

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendMessage
from aiogram.methods import SendMessage
from aiogram.types import Chat, ForceReply, Message, ReplyKeyboardRemove
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendPhoto
from aiogram.methods import SendPhoto
from aiogram.types import Chat, Message, PhotoSize
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendPoll
from aiogram.methods import SendPoll
from aiogram.types import Chat, Message, Poll, PollOption
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendSticker
from aiogram.methods import SendSticker
from aiogram.types import Chat, Message, Sticker
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendVenue
from aiogram.methods import SendVenue
from aiogram.types import Chat, Location, Message, Venue
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendVideo
from aiogram.methods import SendVideo
from aiogram.types import Chat, Message, Video
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendVideoNote
from aiogram.methods import SendVideoNote
from aiogram.types import BufferedInputFile, Chat, Message, VideoNote
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
import datetime
from aiogram.methods import Request, SendVoice
from aiogram.methods import SendVoice
from aiogram.types import Chat, Message, Voice
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatAdministratorCustomTitle
from aiogram.methods import SetChatAdministratorCustomTitle
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatDescription
from aiogram.methods import SetChatDescription
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatMenuButton
from aiogram.methods import SetChatMenuButton
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatPermissions
from aiogram.methods import SetChatPermissions
from aiogram.types import ChatPermissions
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatPhoto
from aiogram.methods import SetChatPhoto
from aiogram.types import BufferedInputFile
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatStickerSet
from aiogram.methods import SetChatStickerSet
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetChatTitle
from aiogram.methods import SetChatTitle
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetCustomEmojiStickerSetThumbnail
from aiogram.methods import SetCustomEmojiStickerSetThumbnail
from tests.mocked_bot import MockedBot

View file

@ -1,6 +1,6 @@
from typing import Union
from aiogram.methods import Request, SetGameScore
from aiogram.methods import SetGameScore
from aiogram.types import Message
from tests.mocked_bot import MockedBot

View file

@ -1,5 +1,4 @@
from aiogram.methods import Request, SetMyCommands
from aiogram.types import BotCommand
from aiogram.methods import SetMyCommands
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetMyDefaultAdministratorRights
from aiogram.methods import SetMyDefaultAdministratorRights
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetMyDescription
from aiogram.methods import SetMyDescription
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetMyDescription, SetMyShortDescription
from aiogram.methods import SetMyShortDescription
from tests.mocked_bot import MockedBot

View file

@ -1,5 +1,5 @@
from aiogram.methods import Request, SetPassportDataErrors
from aiogram.types import PassportElementError, PassportElementErrorFile
from aiogram.methods import SetPassportDataErrors
from aiogram.types import PassportElementErrorFile
from tests.mocked_bot import MockedBot

View file

@ -1,4 +1,4 @@
from aiogram.methods import Request, SetStickerEmojiList
from aiogram.methods import SetStickerEmojiList
from tests.mocked_bot import MockedBot

Some files were not shown because too many files have changed in this diff Show more