mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Clean project
This commit is contained in:
parent
a83dd3ca63
commit
bdae5fb026
259 changed files with 1303 additions and 21135 deletions
|
|
@ -47,11 +47,7 @@ CHAT_MEMBER = {
|
|||
"can_promote_members": False,
|
||||
}
|
||||
|
||||
CONTACT = {
|
||||
"phone_number": "88005553535",
|
||||
"first_name": "John",
|
||||
"last_name": "Smith",
|
||||
}
|
||||
CONTACT = {"phone_number": "88005553535", "first_name": "John", "last_name": "Smith"}
|
||||
|
||||
DOCUMENT = {
|
||||
"file_name": "test.docx",
|
||||
|
|
@ -68,42 +64,17 @@ ANIMATION = {
|
|||
"file_size": 65837,
|
||||
}
|
||||
|
||||
ENTITY_BOLD = {
|
||||
"offset": 5,
|
||||
"length": 2,
|
||||
"type": "bold",
|
||||
}
|
||||
ENTITY_BOLD = {"offset": 5, "length": 2, "type": "bold"}
|
||||
|
||||
ENTITY_ITALIC = {
|
||||
"offset": 8,
|
||||
"length": 1,
|
||||
"type": "italic",
|
||||
}
|
||||
ENTITY_ITALIC = {"offset": 8, "length": 1, "type": "italic"}
|
||||
|
||||
ENTITY_LINK = {
|
||||
"offset": 10,
|
||||
"length": 6,
|
||||
"type": "text_link",
|
||||
"url": "http://google.com/",
|
||||
}
|
||||
ENTITY_LINK = {"offset": 10, "length": 6, "type": "text_link", "url": "http://google.com/"}
|
||||
|
||||
ENTITY_CODE = {
|
||||
"offset": 17,
|
||||
"length": 7,
|
||||
"type": "code",
|
||||
}
|
||||
ENTITY_CODE = {"offset": 17, "length": 7, "type": "code"}
|
||||
|
||||
ENTITY_PRE = {
|
||||
"offset": 30,
|
||||
"length": 4,
|
||||
"type": "pre",
|
||||
}
|
||||
ENTITY_PRE = {"offset": 30, "length": 4, "type": "pre"}
|
||||
|
||||
ENTITY_MENTION = {
|
||||
"offset": 47,
|
||||
"length": 9,
|
||||
"type": "mention",
|
||||
}
|
||||
ENTITY_MENTION = {"offset": 47, "length": 9, "type": "mention"}
|
||||
|
||||
GAME = {
|
||||
"title": "Karate Kido",
|
||||
|
|
@ -115,18 +86,15 @@ GAME = {
|
|||
INVOICE = {
|
||||
"title": "Working Time Machine",
|
||||
"description": "Want to visit your great-great-great-grandparents? "
|
||||
"Make a fortune at the races? "
|
||||
"Shake hands with Hammurabi and take a stroll in the Hanging Gardens? "
|
||||
"Order our Working Time Machine today!",
|
||||
"Make a fortune at the races? "
|
||||
"Shake hands with Hammurabi and take a stroll in the Hanging Gardens? "
|
||||
"Order our Working Time Machine today!",
|
||||
"start_parameter": "time-machine-example",
|
||||
"currency": "USD",
|
||||
"total_amount": 6250,
|
||||
}
|
||||
|
||||
LOCATION = {
|
||||
"latitude": 50.693416,
|
||||
"longitude": 30.624605,
|
||||
}
|
||||
LOCATION = {"latitude": 50.693416, "longitude": 30.624605}
|
||||
|
||||
VENUE = {
|
||||
"location": LOCATION,
|
||||
|
|
@ -153,7 +121,7 @@ STICKER = {
|
|||
"file_id": "AAbbCCddEEffGGhh1234567890",
|
||||
"file_size": 1234,
|
||||
"width": 128,
|
||||
"height": 128
|
||||
"height": 128,
|
||||
},
|
||||
"file_id": "AAbbCCddEEffGGhh1234567890",
|
||||
"file_size": 12345,
|
||||
|
|
@ -218,8 +186,15 @@ FORWARDED_MESSAGE = {
|
|||
"forward_from_message_id": 123,
|
||||
"forward_date": 1522749037,
|
||||
"text": "Forwarded text with entities from public channel ",
|
||||
"entities": [ENTITY_BOLD, ENTITY_CODE, ENTITY_ITALIC, ENTITY_LINK,
|
||||
ENTITY_LINK, ENTITY_MENTION, ENTITY_PRE],
|
||||
"entities": [
|
||||
ENTITY_BOLD,
|
||||
ENTITY_CODE,
|
||||
ENTITY_ITALIC,
|
||||
ENTITY_LINK,
|
||||
ENTITY_LINK,
|
||||
ENTITY_MENTION,
|
||||
ENTITY_PRE,
|
||||
],
|
||||
}
|
||||
|
||||
INLINE_QUERY = {}
|
||||
|
|
@ -416,27 +391,12 @@ SHIPPING_QUERY = {
|
|||
"shipping_address": SHIPPING_ADDRESS,
|
||||
}
|
||||
|
||||
USER_PROFILE_PHOTOS = {
|
||||
"total_count": 1, "photos": [
|
||||
[PHOTO, PHOTO, PHOTO],
|
||||
],
|
||||
}
|
||||
USER_PROFILE_PHOTOS = {"total_count": 1, "photos": [[PHOTO, PHOTO, PHOTO]]}
|
||||
|
||||
FILE = {
|
||||
"file_id": "XXXYYYZZZ",
|
||||
"file_size": 5254,
|
||||
"file_path": "voice/file_8",
|
||||
}
|
||||
FILE = {"file_id": "XXXYYYZZZ", "file_size": 5254, "file_path": "voice/file_8"}
|
||||
|
||||
INVITE_LINK = 'https://t.me/joinchat/AbCdEfjKILDADwdd123'
|
||||
INVITE_LINK = "https://t.me/joinchat/AbCdEfjKILDADwdd123"
|
||||
|
||||
UPDATE = {
|
||||
"update_id": 123456789,
|
||||
"message": MESSAGE,
|
||||
}
|
||||
UPDATE = {"update_id": 123456789, "message": MESSAGE}
|
||||
|
||||
WEBHOOK_INFO = {
|
||||
"url": "",
|
||||
"has_custom_certificate": False,
|
||||
"pending_update_count": 0,
|
||||
}
|
||||
WEBHOOK_INFO = {"url": "", "has_custom_certificate": False, "pending_update_count": 0}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import ANIMATION
|
||||
|
||||
animation = types.Animation(**ANIMATION)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import CHAT
|
||||
|
||||
chat = types.Chat(**CHAT)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import CHAT_MEMBER
|
||||
|
||||
chat_member = types.ChatMember(**CHAT_MEMBER)
|
||||
|
|
@ -16,30 +17,30 @@ def test_user():
|
|||
|
||||
def test_status():
|
||||
assert isinstance(chat_member.status, str)
|
||||
assert chat_member.status == CHAT_MEMBER['status']
|
||||
assert chat_member.status == CHAT_MEMBER["status"]
|
||||
|
||||
|
||||
def test_privileges():
|
||||
assert isinstance(chat_member.can_be_edited, bool)
|
||||
assert chat_member.can_be_edited == CHAT_MEMBER['can_be_edited']
|
||||
assert chat_member.can_be_edited == CHAT_MEMBER["can_be_edited"]
|
||||
|
||||
assert isinstance(chat_member.can_change_info, bool)
|
||||
assert chat_member.can_change_info == CHAT_MEMBER['can_change_info']
|
||||
assert chat_member.can_change_info == CHAT_MEMBER["can_change_info"]
|
||||
|
||||
assert isinstance(chat_member.can_delete_messages, bool)
|
||||
assert chat_member.can_delete_messages == CHAT_MEMBER['can_delete_messages']
|
||||
assert chat_member.can_delete_messages == CHAT_MEMBER["can_delete_messages"]
|
||||
|
||||
assert isinstance(chat_member.can_invite_users, bool)
|
||||
assert chat_member.can_invite_users == CHAT_MEMBER['can_invite_users']
|
||||
assert chat_member.can_invite_users == CHAT_MEMBER["can_invite_users"]
|
||||
|
||||
assert isinstance(chat_member.can_restrict_members, bool)
|
||||
assert chat_member.can_restrict_members == CHAT_MEMBER['can_restrict_members']
|
||||
assert chat_member.can_restrict_members == CHAT_MEMBER["can_restrict_members"]
|
||||
|
||||
assert isinstance(chat_member.can_pin_messages, bool)
|
||||
assert chat_member.can_pin_messages == CHAT_MEMBER['can_pin_messages']
|
||||
assert chat_member.can_pin_messages == CHAT_MEMBER["can_pin_messages"]
|
||||
|
||||
assert isinstance(chat_member.can_promote_members, bool)
|
||||
assert chat_member.can_promote_members == CHAT_MEMBER['can_promote_members']
|
||||
assert chat_member.can_promote_members == CHAT_MEMBER["can_promote_members"]
|
||||
|
||||
|
||||
def test_int():
|
||||
|
|
@ -48,12 +49,12 @@ def test_int():
|
|||
|
||||
|
||||
def test_chat_member_status():
|
||||
assert types.ChatMemberStatus.CREATOR == 'creator'
|
||||
assert types.ChatMemberStatus.ADMINISTRATOR == 'administrator'
|
||||
assert types.ChatMemberStatus.MEMBER == 'member'
|
||||
assert types.ChatMemberStatus.RESTRICTED == 'restricted'
|
||||
assert types.ChatMemberStatus.LEFT == 'left'
|
||||
assert types.ChatMemberStatus.KICKED == 'kicked'
|
||||
assert types.ChatMemberStatus.CREATOR == "creator"
|
||||
assert types.ChatMemberStatus.ADMINISTRATOR == "administrator"
|
||||
assert types.ChatMemberStatus.MEMBER == "member"
|
||||
assert types.ChatMemberStatus.RESTRICTED == "restricted"
|
||||
assert types.ChatMemberStatus.LEFT == "left"
|
||||
assert types.ChatMemberStatus.KICKED == "kicked"
|
||||
|
||||
|
||||
def test_chat_member_status_filters():
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import DOCUMENT
|
||||
|
||||
document = types.Document(**DOCUMENT)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import GAME
|
||||
|
||||
game = types.Game(**GAME)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import datetime
|
||||
|
||||
from aiogram import types
|
||||
|
||||
from .dataset import MESSAGE
|
||||
|
||||
message = types.Message(**MESSAGE)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import PHOTO
|
||||
|
||||
photo = types.PhotoSize(**PHOTO)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
from aiogram import types
|
||||
|
||||
from .dataset import UPDATE
|
||||
|
||||
update = types.Update(**UPDATE)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
from babel import Locale
|
||||
|
||||
from aiogram import types
|
||||
|
||||
from .dataset import USER
|
||||
|
||||
user = types.User(**USER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue