Merge branch 'master' into V12

This commit is contained in:
Pieter Schutz 2018-11-01 11:45:51 +01:00
commit 384173115f
52 changed files with 495 additions and 492 deletions

View file

@ -6,10 +6,12 @@
args: args:
- --diff - --diff
- repo: git://github.com/pre-commit/pre-commit-hooks - repo: git://github.com/pre-commit/pre-commit-hooks
sha: v1.2.0 sha: v2.0.0
hooks: hooks:
- id: flake8 - id: flake8
exclude: ^(setup.py|docs/source/conf.py)$ exclude: ^(setup.py|docs/source/conf.py)$
args:
- --ignore=W605,W503
- repo: git://github.com/pre-commit/mirrors-pylint - repo: git://github.com/pre-commit/mirrors-pylint
sha: v1.7.1 sha: v1.7.1
hooks: hooks:

View file

@ -118,7 +118,7 @@ from .passport.credentials import (Credentials,
SecureData, SecureData,
FileCredentials, FileCredentials,
TelegramDecryptionError) TelegramDecryptionError)
from .version import __version__ # flake8: noqa from .version import __version__ # noqa: F401
__author__ = 'devs@python-telegram-bot.org' __author__ = 'devs@python-telegram-bot.org'

View file

@ -244,11 +244,11 @@ class ConversationHandler(Handler):
""" """
# Ignore messages in channels # Ignore messages in channels
if (not isinstance(update, Update) or if (not isinstance(update, Update)
update.channel_post or or update.channel_post
self.per_chat and not update.effective_chat or or self.per_chat and not update.effective_chat
self.per_message and not update.callback_query or or self.per_message and not update.callback_query
update.callback_query and self.per_chat and not update.callback_query.message): or update.callback_query and self.per_chat and not update.callback_query.message):
return None return None
key = self._get_key(update) key = self._get_key(update)

View file

@ -441,8 +441,8 @@ class Filters(object):
name = 'Filters.status_update.chat_created' name = 'Filters.status_update.chat_created'
def filter(self, message): def filter(self, message):
return bool(message.group_chat_created or message.supergroup_chat_created or return bool(message.group_chat_created or message.supergroup_chat_created
message.channel_chat_created) or message.channel_chat_created)
chat_created = _ChatCreated() chat_created = _ChatCreated()
""":obj:`Filter`: Messages that contain :attr:`telegram.Message.group_chat_created`, """:obj:`Filter`: Messages that contain :attr:`telegram.Message.group_chat_created`,
@ -480,11 +480,11 @@ class Filters(object):
name = 'Filters.status_update' name = 'Filters.status_update'
def filter(self, message): def filter(self, message):
return bool(self.new_chat_members(message) or self.left_chat_member(message) or return bool(self.new_chat_members(message) or self.left_chat_member(message)
self.new_chat_title(message) or self.new_chat_photo(message) or or self.new_chat_title(message) or self.new_chat_photo(message)
self.delete_chat_photo(message) or self.chat_created(message) or or self.delete_chat_photo(message) or self.chat_created(message)
self.migrate(message) or self.pinned_message(message) or or self.migrate(message) or self.pinned_message(message)
self.connected_website(message)) or self.connected_website(message))
status_update = _StatusUpdate() status_update = _StatusUpdate()
"""Subset for messages containing a status update. """Subset for messages containing a status update.
@ -628,8 +628,8 @@ class Filters(object):
return bool(message.from_user and message.from_user.id in self.user_ids) return bool(message.from_user and message.from_user.id in self.user_ids)
else: else:
# self.usernames is not None # self.usernames is not None
return bool(message.from_user and message.from_user.username and return bool(message.from_user and message.from_user.username
message.from_user.username in self.usernames) and message.from_user.username in self.usernames)
class chat(BaseFilter): class chat(BaseFilter):
"""Filters messages to allow only those which are from specified chat ID. """Filters messages to allow only those which are from specified chat ID.

View file

@ -55,9 +55,9 @@ class InputFile(object):
if filename: if filename:
self.filename = filename self.filename = filename
elif (hasattr(obj, 'name') and elif (hasattr(obj, 'name')
not isinstance(obj.name, int) and # py3 and not isinstance(obj.name, int) # py3
obj.name != '<fdopen>'): # py2 and obj.name != '<fdopen>'): # py2
# on py2.7, pylint fails to understand this properly # on py2.7, pylint fails to understand this properly
# pylint: disable=E1101 # pylint: disable=E1101
self.filename = os.path.basename(obj.name) self.filename = os.path.basename(obj.name)

View file

@ -148,8 +148,8 @@ class PassportElementErrorFiles(PassportElementError):
super(PassportElementErrorFiles, self).__init__('files', type, message) super(PassportElementErrorFiles, self).__init__('files', type, message)
self.file_hashes = file_hashes self.file_hashes = file_hashes
self._id_attrs = ((self.source, self.type, self.message) + self._id_attrs = ((self.source, self.type, self.message)
tuple([file_hash for file_hash in file_hashes])) + tuple([file_hash for file_hash in file_hashes]))
class PassportElementErrorFrontSide(PassportElementError): class PassportElementErrorFrontSide(PassportElementError):
@ -323,8 +323,8 @@ class PassportElementErrorTranslationFiles(PassportElementError):
type, message) type, message)
self.file_hashes = file_hashes self.file_hashes = file_hashes
self._id_attrs = ((self.source, self.type, self.message) + self._id_attrs = ((self.source, self.type, self.message)
tuple([file_hash for file_hash in file_hashes])) + tuple([file_hash for file_hash in file_hashes]))
class PassportElementErrorUnspecified(PassportElementError): class PassportElementErrorUnspecified(PassportElementError):

View file

@ -43,12 +43,12 @@ class TestEncryptedCredentials(object):
encrypted_credentials_dict = encrypted_credentials.to_dict() encrypted_credentials_dict = encrypted_credentials.to_dict()
assert isinstance(encrypted_credentials_dict, dict) assert isinstance(encrypted_credentials_dict, dict)
assert (encrypted_credentials_dict['data'] == assert (encrypted_credentials_dict['data']
encrypted_credentials.data) == encrypted_credentials.data)
assert (encrypted_credentials_dict['hash'] == assert (encrypted_credentials_dict['hash']
encrypted_credentials.hash) == encrypted_credentials.hash)
assert (encrypted_credentials_dict['secret'] == assert (encrypted_credentials_dict['secret']
encrypted_credentials.secret) == encrypted_credentials.secret)
def test_equality(self): def test_equality(self):
a = EncryptedCredentials(self.data, self.hash, self.secret) a = EncryptedCredentials(self.data, self.hash, self.secret)

View file

@ -58,21 +58,21 @@ class TestEncryptedPassportElement(object):
encrypted_passport_element_dict = encrypted_passport_element.to_dict() encrypted_passport_element_dict = encrypted_passport_element.to_dict()
assert isinstance(encrypted_passport_element_dict, dict) assert isinstance(encrypted_passport_element_dict, dict)
assert (encrypted_passport_element_dict['type'] == assert (encrypted_passport_element_dict['type']
encrypted_passport_element.type) == encrypted_passport_element.type)
assert (encrypted_passport_element_dict['data'] == assert (encrypted_passport_element_dict['data']
encrypted_passport_element.data) == encrypted_passport_element.data)
assert (encrypted_passport_element_dict['phone_number'] == assert (encrypted_passport_element_dict['phone_number']
encrypted_passport_element.phone_number) == encrypted_passport_element.phone_number)
assert (encrypted_passport_element_dict['email'] == assert (encrypted_passport_element_dict['email']
encrypted_passport_element.email) == encrypted_passport_element.email)
assert isinstance(encrypted_passport_element_dict['files'], list) assert isinstance(encrypted_passport_element_dict['files'], list)
assert (encrypted_passport_element_dict['front_side'] == assert (encrypted_passport_element_dict['front_side']
encrypted_passport_element.front_side.to_dict()) == encrypted_passport_element.front_side.to_dict())
assert (encrypted_passport_element_dict['reverse_side'] == assert (encrypted_passport_element_dict['reverse_side']
encrypted_passport_element.reverse_side.to_dict()) == encrypted_passport_element.reverse_side.to_dict())
assert (encrypted_passport_element_dict['selfie'] == assert (encrypted_passport_element_dict['selfie']
encrypted_passport_element.selfie.to_dict()) == encrypted_passport_element.selfie.to_dict())
def test_equality(self): def test_equality(self):
a = EncryptedPassportElement(self.type, data=self.data) a = EncryptedPassportElement(self.type, data=self.data)

View file

@ -48,8 +48,8 @@ class TestInlineKeyboardButton(object):
assert inline_keyboard_button.url == self.url assert inline_keyboard_button.url == self.url
assert inline_keyboard_button.callback_data == self.callback_data assert inline_keyboard_button.callback_data == self.callback_data
assert inline_keyboard_button.switch_inline_query == self.switch_inline_query assert inline_keyboard_button.switch_inline_query == self.switch_inline_query
assert (inline_keyboard_button.switch_inline_query_current_chat == assert (inline_keyboard_button.switch_inline_query_current_chat
self.switch_inline_query_current_chat) == self.switch_inline_query_current_chat)
assert inline_keyboard_button.callback_game == self.callback_game assert inline_keyboard_button.callback_game == self.callback_game
assert inline_keyboard_button.pay == self.pay assert inline_keyboard_button.pay == self.pay
@ -60,9 +60,9 @@ class TestInlineKeyboardButton(object):
assert inline_keyboard_button_dict['text'] == inline_keyboard_button.text assert inline_keyboard_button_dict['text'] == inline_keyboard_button.text
assert inline_keyboard_button_dict['url'] == inline_keyboard_button.url assert inline_keyboard_button_dict['url'] == inline_keyboard_button.url
assert inline_keyboard_button_dict['callback_data'] == inline_keyboard_button.callback_data assert inline_keyboard_button_dict['callback_data'] == inline_keyboard_button.callback_data
assert (inline_keyboard_button_dict['switch_inline_query'] == assert (inline_keyboard_button_dict['switch_inline_query']
inline_keyboard_button.switch_inline_query) == inline_keyboard_button.switch_inline_query)
assert (inline_keyboard_button_dict['switch_inline_query_current_chat'] == assert (inline_keyboard_button_dict['switch_inline_query_current_chat']
inline_keyboard_button.switch_inline_query_current_chat) == inline_keyboard_button.switch_inline_query_current_chat)
assert inline_keyboard_button_dict['callback_game'] == inline_keyboard_button.callback_game assert inline_keyboard_button_dict['callback_game'] == inline_keyboard_button.callback_game
assert inline_keyboard_button_dict['pay'] == inline_keyboard_button.pay assert inline_keyboard_button_dict['pay'] == inline_keyboard_button.pay

View file

@ -55,8 +55,8 @@ class TestInlineQueryResultArticle(object):
assert inline_query_result_article.type == self.type assert inline_query_result_article.type == self.type
assert inline_query_result_article.id == self.id assert inline_query_result_article.id == self.id
assert inline_query_result_article.title == self.title assert inline_query_result_article.title == self.title
assert (inline_query_result_article.input_message_content.to_dict() == assert (inline_query_result_article.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_article.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_article.reply_markup.to_dict() == self.reply_markup.to_dict()
assert inline_query_result_article.url == self.url assert inline_query_result_article.url == self.url
assert inline_query_result_article.hide_url == self.hide_url assert inline_query_result_article.hide_url == self.hide_url
@ -72,20 +72,20 @@ class TestInlineQueryResultArticle(object):
assert inline_query_result_article_dict['type'] == inline_query_result_article.type assert inline_query_result_article_dict['type'] == inline_query_result_article.type
assert inline_query_result_article_dict['id'] == inline_query_result_article.id assert inline_query_result_article_dict['id'] == inline_query_result_article.id
assert inline_query_result_article_dict['title'] == inline_query_result_article.title assert inline_query_result_article_dict['title'] == inline_query_result_article.title
assert (inline_query_result_article_dict['input_message_content'] == assert (inline_query_result_article_dict['input_message_content']
inline_query_result_article.input_message_content.to_dict()) == inline_query_result_article.input_message_content.to_dict())
assert (inline_query_result_article_dict['reply_markup'] == assert (inline_query_result_article_dict['reply_markup']
inline_query_result_article.reply_markup.to_dict()) == inline_query_result_article.reply_markup.to_dict())
assert inline_query_result_article_dict['url'] == inline_query_result_article.url assert inline_query_result_article_dict['url'] == inline_query_result_article.url
assert inline_query_result_article_dict['hide_url'] == inline_query_result_article.hide_url assert inline_query_result_article_dict['hide_url'] == inline_query_result_article.hide_url
assert (inline_query_result_article_dict['description'] == assert (inline_query_result_article_dict['description']
inline_query_result_article.description) == inline_query_result_article.description)
assert (inline_query_result_article_dict['thumb_url'] == assert (inline_query_result_article_dict['thumb_url']
inline_query_result_article.thumb_url) == inline_query_result_article.thumb_url)
assert (inline_query_result_article_dict['thumb_height'] == assert (inline_query_result_article_dict['thumb_height']
inline_query_result_article.thumb_height) == inline_query_result_article.thumb_height)
assert (inline_query_result_article_dict['thumb_width'] == assert (inline_query_result_article_dict['thumb_width']
inline_query_result_article.thumb_width) == inline_query_result_article.thumb_width)
def test_equality(self): def test_equality(self):
a = InlineQueryResultArticle(self.id, self.title, self.input_message_content) a = InlineQueryResultArticle(self.id, self.title, self.input_message_content)

View file

@ -58,8 +58,8 @@ class TestInlineQueryResultAudio(object):
assert inline_query_result_audio.audio_duration == self.audio_duration assert inline_query_result_audio.audio_duration == self.audio_duration
assert inline_query_result_audio.caption == self.caption assert inline_query_result_audio.caption == self.caption
assert inline_query_result_audio.parse_mode == self.parse_mode assert inline_query_result_audio.parse_mode == self.parse_mode
assert (inline_query_result_audio.input_message_content.to_dict() == assert (inline_query_result_audio.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_audio.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_audio.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_audio): def test_to_dict(self, inline_query_result_audio):
@ -71,14 +71,14 @@ class TestInlineQueryResultAudio(object):
assert inline_query_result_audio_dict['audio_url'] == inline_query_result_audio.audio_url assert inline_query_result_audio_dict['audio_url'] == inline_query_result_audio.audio_url
assert inline_query_result_audio_dict['title'] == inline_query_result_audio.title assert inline_query_result_audio_dict['title'] == inline_query_result_audio.title
assert inline_query_result_audio_dict['performer'] == inline_query_result_audio.performer assert inline_query_result_audio_dict['performer'] == inline_query_result_audio.performer
assert (inline_query_result_audio_dict['audio_duration'] == assert (inline_query_result_audio_dict['audio_duration']
inline_query_result_audio.audio_duration) == inline_query_result_audio.audio_duration)
assert inline_query_result_audio_dict['caption'] == inline_query_result_audio.caption assert inline_query_result_audio_dict['caption'] == inline_query_result_audio.caption
assert inline_query_result_audio_dict['parse_mode'] == inline_query_result_audio.parse_mode assert inline_query_result_audio_dict['parse_mode'] == inline_query_result_audio.parse_mode
assert (inline_query_result_audio_dict['input_message_content'] == assert (inline_query_result_audio_dict['input_message_content']
inline_query_result_audio.input_message_content.to_dict()) == inline_query_result_audio.input_message_content.to_dict())
assert (inline_query_result_audio_dict['reply_markup'] == assert (inline_query_result_audio_dict['reply_markup']
inline_query_result_audio.reply_markup.to_dict()) == inline_query_result_audio.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultAudio(self.id, self.audio_url, self.title) a = InlineQueryResultAudio(self.id, self.audio_url, self.title)

View file

@ -49,28 +49,28 @@ class TestInlineQueryResultCachedAudio(object):
assert inline_query_result_cached_audio.audio_file_id == self.audio_file_id assert inline_query_result_cached_audio.audio_file_id == self.audio_file_id
assert inline_query_result_cached_audio.caption == self.caption assert inline_query_result_cached_audio.caption == self.caption
assert inline_query_result_cached_audio.parse_mode == self.parse_mode assert inline_query_result_cached_audio.parse_mode == self.parse_mode
assert (inline_query_result_cached_audio.input_message_content.to_dict() == assert (inline_query_result_cached_audio.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_audio.reply_markup.to_dict() == assert (inline_query_result_cached_audio.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_audio): def test_to_dict(self, inline_query_result_cached_audio):
inline_query_result_cached_audio_dict = inline_query_result_cached_audio.to_dict() inline_query_result_cached_audio_dict = inline_query_result_cached_audio.to_dict()
assert isinstance(inline_query_result_cached_audio_dict, dict) assert isinstance(inline_query_result_cached_audio_dict, dict)
assert (inline_query_result_cached_audio_dict['type'] == assert (inline_query_result_cached_audio_dict['type']
inline_query_result_cached_audio.type) == inline_query_result_cached_audio.type)
assert inline_query_result_cached_audio_dict['id'] == inline_query_result_cached_audio.id assert inline_query_result_cached_audio_dict['id'] == inline_query_result_cached_audio.id
assert (inline_query_result_cached_audio_dict['audio_file_id'] == assert (inline_query_result_cached_audio_dict['audio_file_id']
inline_query_result_cached_audio.audio_file_id) == inline_query_result_cached_audio.audio_file_id)
assert (inline_query_result_cached_audio_dict['caption'] == assert (inline_query_result_cached_audio_dict['caption']
inline_query_result_cached_audio.caption) == inline_query_result_cached_audio.caption)
assert (inline_query_result_cached_audio_dict['parse_mode'] == assert (inline_query_result_cached_audio_dict['parse_mode']
inline_query_result_cached_audio.parse_mode) == inline_query_result_cached_audio.parse_mode)
assert (inline_query_result_cached_audio_dict['input_message_content'] == assert (inline_query_result_cached_audio_dict['input_message_content']
inline_query_result_cached_audio.input_message_content.to_dict()) == inline_query_result_cached_audio.input_message_content.to_dict())
assert (inline_query_result_cached_audio_dict['reply_markup'] == assert (inline_query_result_cached_audio_dict['reply_markup']
inline_query_result_cached_audio.reply_markup.to_dict()) == inline_query_result_cached_audio.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedAudio(self.id, self.audio_file_id) a = InlineQueryResultCachedAudio(self.id, self.audio_file_id)

View file

@ -55,33 +55,33 @@ class TestInlineQueryResultCachedDocument(object):
assert inline_query_result_cached_document.caption == self.caption assert inline_query_result_cached_document.caption == self.caption
assert inline_query_result_cached_document.parse_mode == self.parse_mode assert inline_query_result_cached_document.parse_mode == self.parse_mode
assert inline_query_result_cached_document.description == self.description assert inline_query_result_cached_document.description == self.description
assert (inline_query_result_cached_document.input_message_content.to_dict() == assert (inline_query_result_cached_document.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_document.reply_markup.to_dict() == assert (inline_query_result_cached_document.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_document): def test_to_dict(self, inline_query_result_cached_document):
inline_query_result_cached_document_dict = inline_query_result_cached_document.to_dict() inline_query_result_cached_document_dict = inline_query_result_cached_document.to_dict()
assert isinstance(inline_query_result_cached_document_dict, dict) assert isinstance(inline_query_result_cached_document_dict, dict)
assert (inline_query_result_cached_document_dict['id'] == assert (inline_query_result_cached_document_dict['id']
inline_query_result_cached_document.id) == inline_query_result_cached_document.id)
assert (inline_query_result_cached_document_dict['type'] == assert (inline_query_result_cached_document_dict['type']
inline_query_result_cached_document.type) == inline_query_result_cached_document.type)
assert (inline_query_result_cached_document_dict['document_file_id'] == assert (inline_query_result_cached_document_dict['document_file_id']
inline_query_result_cached_document.document_file_id) == inline_query_result_cached_document.document_file_id)
assert (inline_query_result_cached_document_dict['title'] == assert (inline_query_result_cached_document_dict['title']
inline_query_result_cached_document.title) == inline_query_result_cached_document.title)
assert (inline_query_result_cached_document_dict['caption'] == assert (inline_query_result_cached_document_dict['caption']
inline_query_result_cached_document.caption) == inline_query_result_cached_document.caption)
assert (inline_query_result_cached_document_dict['parse_mode'] == assert (inline_query_result_cached_document_dict['parse_mode']
inline_query_result_cached_document.parse_mode) == inline_query_result_cached_document.parse_mode)
assert (inline_query_result_cached_document_dict['description'] == assert (inline_query_result_cached_document_dict['description']
inline_query_result_cached_document.description) == inline_query_result_cached_document.description)
assert (inline_query_result_cached_document_dict['input_message_content'] == assert (inline_query_result_cached_document_dict['input_message_content']
inline_query_result_cached_document.input_message_content.to_dict()) == inline_query_result_cached_document.input_message_content.to_dict())
assert (inline_query_result_cached_document_dict['reply_markup'] == assert (inline_query_result_cached_document_dict['reply_markup']
inline_query_result_cached_document.reply_markup.to_dict()) == inline_query_result_cached_document.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedDocument(self.id, self.title, self.document_file_id) a = InlineQueryResultCachedDocument(self.id, self.title, self.document_file_id)

View file

@ -52,8 +52,8 @@ class TestInlineQueryResultCachedGif(object):
assert inline_query_result_cached_gif.title == self.title assert inline_query_result_cached_gif.title == self.title
assert inline_query_result_cached_gif.caption == self.caption assert inline_query_result_cached_gif.caption == self.caption
assert inline_query_result_cached_gif.parse_mode == self.parse_mode assert inline_query_result_cached_gif.parse_mode == self.parse_mode
assert (inline_query_result_cached_gif.input_message_content.to_dict() == assert (inline_query_result_cached_gif.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_cached_gif.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_cached_gif.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_cached_gif): def test_to_dict(self, inline_query_result_cached_gif):
@ -62,17 +62,17 @@ class TestInlineQueryResultCachedGif(object):
assert isinstance(inline_query_result_cached_gif_dict, dict) assert isinstance(inline_query_result_cached_gif_dict, dict)
assert inline_query_result_cached_gif_dict['type'] == inline_query_result_cached_gif.type assert inline_query_result_cached_gif_dict['type'] == inline_query_result_cached_gif.type
assert inline_query_result_cached_gif_dict['id'] == inline_query_result_cached_gif.id assert inline_query_result_cached_gif_dict['id'] == inline_query_result_cached_gif.id
assert (inline_query_result_cached_gif_dict['gif_file_id'] == assert (inline_query_result_cached_gif_dict['gif_file_id']
inline_query_result_cached_gif.gif_file_id) == inline_query_result_cached_gif.gif_file_id)
assert inline_query_result_cached_gif_dict['title'] == inline_query_result_cached_gif.title assert inline_query_result_cached_gif_dict['title'] == inline_query_result_cached_gif.title
assert (inline_query_result_cached_gif_dict['caption'] == assert (inline_query_result_cached_gif_dict['caption']
inline_query_result_cached_gif.caption) == inline_query_result_cached_gif.caption)
assert (inline_query_result_cached_gif_dict['parse_mode'] == assert (inline_query_result_cached_gif_dict['parse_mode']
inline_query_result_cached_gif.parse_mode) == inline_query_result_cached_gif.parse_mode)
assert (inline_query_result_cached_gif_dict['input_message_content'] == assert (inline_query_result_cached_gif_dict['input_message_content']
inline_query_result_cached_gif.input_message_content.to_dict()) == inline_query_result_cached_gif.input_message_content.to_dict())
assert (inline_query_result_cached_gif_dict['reply_markup'] == assert (inline_query_result_cached_gif_dict['reply_markup']
inline_query_result_cached_gif.reply_markup.to_dict()) == inline_query_result_cached_gif.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedGif(self.id, self.gif_file_id) a = InlineQueryResultCachedGif(self.id, self.gif_file_id)

View file

@ -52,31 +52,31 @@ class TestInlineQueryResultCachedMpeg4Gif(object):
assert inline_query_result_cached_mpeg4_gif.title == self.title assert inline_query_result_cached_mpeg4_gif.title == self.title
assert inline_query_result_cached_mpeg4_gif.caption == self.caption assert inline_query_result_cached_mpeg4_gif.caption == self.caption
assert inline_query_result_cached_mpeg4_gif.parse_mode == self.parse_mode assert inline_query_result_cached_mpeg4_gif.parse_mode == self.parse_mode
assert (inline_query_result_cached_mpeg4_gif.input_message_content.to_dict() == assert (inline_query_result_cached_mpeg4_gif.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_mpeg4_gif.reply_markup.to_dict() == assert (inline_query_result_cached_mpeg4_gif.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_mpeg4_gif): def test_to_dict(self, inline_query_result_cached_mpeg4_gif):
inline_query_result_cached_mpeg4_gif_dict = inline_query_result_cached_mpeg4_gif.to_dict() inline_query_result_cached_mpeg4_gif_dict = inline_query_result_cached_mpeg4_gif.to_dict()
assert isinstance(inline_query_result_cached_mpeg4_gif_dict, dict) assert isinstance(inline_query_result_cached_mpeg4_gif_dict, dict)
assert (inline_query_result_cached_mpeg4_gif_dict['type'] == assert (inline_query_result_cached_mpeg4_gif_dict['type']
inline_query_result_cached_mpeg4_gif.type) == inline_query_result_cached_mpeg4_gif.type)
assert (inline_query_result_cached_mpeg4_gif_dict['id'] == assert (inline_query_result_cached_mpeg4_gif_dict['id']
inline_query_result_cached_mpeg4_gif.id) == inline_query_result_cached_mpeg4_gif.id)
assert (inline_query_result_cached_mpeg4_gif_dict['mpeg4_file_id'] == assert (inline_query_result_cached_mpeg4_gif_dict['mpeg4_file_id']
inline_query_result_cached_mpeg4_gif.mpeg4_file_id) == inline_query_result_cached_mpeg4_gif.mpeg4_file_id)
assert (inline_query_result_cached_mpeg4_gif_dict['title'] == assert (inline_query_result_cached_mpeg4_gif_dict['title']
inline_query_result_cached_mpeg4_gif.title) == inline_query_result_cached_mpeg4_gif.title)
assert (inline_query_result_cached_mpeg4_gif_dict['caption'] == assert (inline_query_result_cached_mpeg4_gif_dict['caption']
inline_query_result_cached_mpeg4_gif.caption) == inline_query_result_cached_mpeg4_gif.caption)
assert (inline_query_result_cached_mpeg4_gif_dict['parse_mode'] == assert (inline_query_result_cached_mpeg4_gif_dict['parse_mode']
inline_query_result_cached_mpeg4_gif.parse_mode) == inline_query_result_cached_mpeg4_gif.parse_mode)
assert (inline_query_result_cached_mpeg4_gif_dict['input_message_content'] == assert (inline_query_result_cached_mpeg4_gif_dict['input_message_content']
inline_query_result_cached_mpeg4_gif.input_message_content.to_dict()) == inline_query_result_cached_mpeg4_gif.input_message_content.to_dict())
assert (inline_query_result_cached_mpeg4_gif_dict['reply_markup'] == assert (inline_query_result_cached_mpeg4_gif_dict['reply_markup']
inline_query_result_cached_mpeg4_gif.reply_markup.to_dict()) == inline_query_result_cached_mpeg4_gif.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedMpeg4Gif(self.id, self.mpeg4_file_id) a = InlineQueryResultCachedMpeg4Gif(self.id, self.mpeg4_file_id)

View file

@ -55,32 +55,32 @@ class TestInlineQueryResultCachedPhoto(object):
assert inline_query_result_cached_photo.description == self.description assert inline_query_result_cached_photo.description == self.description
assert inline_query_result_cached_photo.caption == self.caption assert inline_query_result_cached_photo.caption == self.caption
assert inline_query_result_cached_photo.parse_mode == self.parse_mode assert inline_query_result_cached_photo.parse_mode == self.parse_mode
assert (inline_query_result_cached_photo.input_message_content.to_dict() == assert (inline_query_result_cached_photo.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_photo.reply_markup.to_dict() == assert (inline_query_result_cached_photo.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_photo): def test_to_dict(self, inline_query_result_cached_photo):
inline_query_result_cached_photo_dict = inline_query_result_cached_photo.to_dict() inline_query_result_cached_photo_dict = inline_query_result_cached_photo.to_dict()
assert isinstance(inline_query_result_cached_photo_dict, dict) assert isinstance(inline_query_result_cached_photo_dict, dict)
assert (inline_query_result_cached_photo_dict['type'] == assert (inline_query_result_cached_photo_dict['type']
inline_query_result_cached_photo.type) == inline_query_result_cached_photo.type)
assert inline_query_result_cached_photo_dict['id'] == inline_query_result_cached_photo.id assert inline_query_result_cached_photo_dict['id'] == inline_query_result_cached_photo.id
assert (inline_query_result_cached_photo_dict['photo_file_id'] == assert (inline_query_result_cached_photo_dict['photo_file_id']
inline_query_result_cached_photo.photo_file_id) == inline_query_result_cached_photo.photo_file_id)
assert (inline_query_result_cached_photo_dict['title'] == assert (inline_query_result_cached_photo_dict['title']
inline_query_result_cached_photo.title) == inline_query_result_cached_photo.title)
assert (inline_query_result_cached_photo_dict['description'] == assert (inline_query_result_cached_photo_dict['description']
inline_query_result_cached_photo.description) == inline_query_result_cached_photo.description)
assert (inline_query_result_cached_photo_dict['caption'] == assert (inline_query_result_cached_photo_dict['caption']
inline_query_result_cached_photo.caption) == inline_query_result_cached_photo.caption)
assert (inline_query_result_cached_photo_dict['parse_mode'] == assert (inline_query_result_cached_photo_dict['parse_mode']
inline_query_result_cached_photo.parse_mode) == inline_query_result_cached_photo.parse_mode)
assert (inline_query_result_cached_photo_dict['input_message_content'] == assert (inline_query_result_cached_photo_dict['input_message_content']
inline_query_result_cached_photo.input_message_content.to_dict()) == inline_query_result_cached_photo.input_message_content.to_dict())
assert (inline_query_result_cached_photo_dict['reply_markup'] == assert (inline_query_result_cached_photo_dict['reply_markup']
inline_query_result_cached_photo.reply_markup.to_dict()) == inline_query_result_cached_photo.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedPhoto(self.id, self.photo_file_id) a = InlineQueryResultCachedPhoto(self.id, self.photo_file_id)

View file

@ -44,25 +44,25 @@ class TestInlineQueryResultCachedSticker(object):
assert inline_query_result_cached_sticker.type == self.type assert inline_query_result_cached_sticker.type == self.type
assert inline_query_result_cached_sticker.id == self.id assert inline_query_result_cached_sticker.id == self.id
assert inline_query_result_cached_sticker.sticker_file_id == self.sticker_file_id assert inline_query_result_cached_sticker.sticker_file_id == self.sticker_file_id
assert (inline_query_result_cached_sticker.input_message_content.to_dict() == assert (inline_query_result_cached_sticker.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_sticker.reply_markup.to_dict() == assert (inline_query_result_cached_sticker.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_sticker): def test_to_dict(self, inline_query_result_cached_sticker):
inline_query_result_cached_sticker_dict = inline_query_result_cached_sticker.to_dict() inline_query_result_cached_sticker_dict = inline_query_result_cached_sticker.to_dict()
assert isinstance(inline_query_result_cached_sticker_dict, dict) assert isinstance(inline_query_result_cached_sticker_dict, dict)
assert (inline_query_result_cached_sticker_dict['type'] == assert (inline_query_result_cached_sticker_dict['type']
inline_query_result_cached_sticker.type) == inline_query_result_cached_sticker.type)
assert (inline_query_result_cached_sticker_dict['id'] == assert (inline_query_result_cached_sticker_dict['id']
inline_query_result_cached_sticker.id) == inline_query_result_cached_sticker.id)
assert (inline_query_result_cached_sticker_dict['sticker_file_id'] == assert (inline_query_result_cached_sticker_dict['sticker_file_id']
inline_query_result_cached_sticker.sticker_file_id) == inline_query_result_cached_sticker.sticker_file_id)
assert (inline_query_result_cached_sticker_dict['input_message_content'] == assert (inline_query_result_cached_sticker_dict['input_message_content']
inline_query_result_cached_sticker.input_message_content.to_dict()) == inline_query_result_cached_sticker.input_message_content.to_dict())
assert (inline_query_result_cached_sticker_dict['reply_markup'] == assert (inline_query_result_cached_sticker_dict['reply_markup']
inline_query_result_cached_sticker.reply_markup.to_dict()) == inline_query_result_cached_sticker.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedSticker(self.id, self.sticker_file_id) a = InlineQueryResultCachedSticker(self.id, self.sticker_file_id)

View file

@ -55,32 +55,32 @@ class TestInlineQueryResultCachedVideo(object):
assert inline_query_result_cached_video.description == self.description assert inline_query_result_cached_video.description == self.description
assert inline_query_result_cached_video.caption == self.caption assert inline_query_result_cached_video.caption == self.caption
assert inline_query_result_cached_video.parse_mode == self.parse_mode assert inline_query_result_cached_video.parse_mode == self.parse_mode
assert (inline_query_result_cached_video.input_message_content.to_dict() == assert (inline_query_result_cached_video.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_video.reply_markup.to_dict() == assert (inline_query_result_cached_video.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_video): def test_to_dict(self, inline_query_result_cached_video):
inline_query_result_cached_video_dict = inline_query_result_cached_video.to_dict() inline_query_result_cached_video_dict = inline_query_result_cached_video.to_dict()
assert isinstance(inline_query_result_cached_video_dict, dict) assert isinstance(inline_query_result_cached_video_dict, dict)
assert (inline_query_result_cached_video_dict['type'] == assert (inline_query_result_cached_video_dict['type']
inline_query_result_cached_video.type) == inline_query_result_cached_video.type)
assert inline_query_result_cached_video_dict['id'] == inline_query_result_cached_video.id assert inline_query_result_cached_video_dict['id'] == inline_query_result_cached_video.id
assert (inline_query_result_cached_video_dict['video_file_id'] == assert (inline_query_result_cached_video_dict['video_file_id']
inline_query_result_cached_video.video_file_id) == inline_query_result_cached_video.video_file_id)
assert (inline_query_result_cached_video_dict['title'] == assert (inline_query_result_cached_video_dict['title']
inline_query_result_cached_video.title) == inline_query_result_cached_video.title)
assert (inline_query_result_cached_video_dict['description'] == assert (inline_query_result_cached_video_dict['description']
inline_query_result_cached_video.description) == inline_query_result_cached_video.description)
assert (inline_query_result_cached_video_dict['caption'] == assert (inline_query_result_cached_video_dict['caption']
inline_query_result_cached_video.caption) == inline_query_result_cached_video.caption)
assert (inline_query_result_cached_video_dict['parse_mode'] == assert (inline_query_result_cached_video_dict['parse_mode']
inline_query_result_cached_video.parse_mode) == inline_query_result_cached_video.parse_mode)
assert (inline_query_result_cached_video_dict['input_message_content'] == assert (inline_query_result_cached_video_dict['input_message_content']
inline_query_result_cached_video.input_message_content.to_dict()) == inline_query_result_cached_video.input_message_content.to_dict())
assert (inline_query_result_cached_video_dict['reply_markup'] == assert (inline_query_result_cached_video_dict['reply_markup']
inline_query_result_cached_video.reply_markup.to_dict()) == inline_query_result_cached_video.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedVideo(self.id, self.video_file_id, self.title) a = InlineQueryResultCachedVideo(self.id, self.video_file_id, self.title)

View file

@ -52,30 +52,30 @@ class TestInlineQueryResultCachedVoice(object):
assert inline_query_result_cached_voice.title == self.title assert inline_query_result_cached_voice.title == self.title
assert inline_query_result_cached_voice.caption == self.caption assert inline_query_result_cached_voice.caption == self.caption
assert inline_query_result_cached_voice.parse_mode == self.parse_mode assert inline_query_result_cached_voice.parse_mode == self.parse_mode
assert (inline_query_result_cached_voice.input_message_content.to_dict() == assert (inline_query_result_cached_voice.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert (inline_query_result_cached_voice.reply_markup.to_dict() == assert (inline_query_result_cached_voice.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_cached_voice): def test_to_dict(self, inline_query_result_cached_voice):
inline_query_result_cached_voice_dict = inline_query_result_cached_voice.to_dict() inline_query_result_cached_voice_dict = inline_query_result_cached_voice.to_dict()
assert isinstance(inline_query_result_cached_voice_dict, dict) assert isinstance(inline_query_result_cached_voice_dict, dict)
assert (inline_query_result_cached_voice_dict['type'] == assert (inline_query_result_cached_voice_dict['type']
inline_query_result_cached_voice.type) == inline_query_result_cached_voice.type)
assert inline_query_result_cached_voice_dict['id'] == inline_query_result_cached_voice.id assert inline_query_result_cached_voice_dict['id'] == inline_query_result_cached_voice.id
assert (inline_query_result_cached_voice_dict['voice_file_id'] == assert (inline_query_result_cached_voice_dict['voice_file_id']
inline_query_result_cached_voice.voice_file_id) == inline_query_result_cached_voice.voice_file_id)
assert (inline_query_result_cached_voice_dict['title'] == assert (inline_query_result_cached_voice_dict['title']
inline_query_result_cached_voice.title) == inline_query_result_cached_voice.title)
assert (inline_query_result_cached_voice_dict['caption'] == assert (inline_query_result_cached_voice_dict['caption']
inline_query_result_cached_voice.caption) == inline_query_result_cached_voice.caption)
assert (inline_query_result_cached_voice_dict['parse_mode'] == assert (inline_query_result_cached_voice_dict['parse_mode']
inline_query_result_cached_voice.parse_mode) == inline_query_result_cached_voice.parse_mode)
assert (inline_query_result_cached_voice_dict['input_message_content'] == assert (inline_query_result_cached_voice_dict['input_message_content']
inline_query_result_cached_voice.input_message_content.to_dict()) == inline_query_result_cached_voice.input_message_content.to_dict())
assert (inline_query_result_cached_voice_dict['reply_markup'] == assert (inline_query_result_cached_voice_dict['reply_markup']
inline_query_result_cached_voice.reply_markup.to_dict()) == inline_query_result_cached_voice.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultCachedVoice(self.id, self.voice_file_id, self.title) a = InlineQueryResultCachedVoice(self.id, self.voice_file_id, self.title)

View file

@ -58,8 +58,8 @@ class TestInlineQueryResultContact(object):
assert inline_query_result_contact.thumb_url == self.thumb_url assert inline_query_result_contact.thumb_url == self.thumb_url
assert inline_query_result_contact.thumb_width == self.thumb_width assert inline_query_result_contact.thumb_width == self.thumb_width
assert inline_query_result_contact.thumb_height == self.thumb_height assert inline_query_result_contact.thumb_height == self.thumb_height
assert (inline_query_result_contact.input_message_content.to_dict() == assert (inline_query_result_contact.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_contact.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_contact.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_contact): def test_to_dict(self, inline_query_result_contact):
@ -68,22 +68,22 @@ class TestInlineQueryResultContact(object):
assert isinstance(inline_query_result_contact_dict, dict) assert isinstance(inline_query_result_contact_dict, dict)
assert inline_query_result_contact_dict['id'] == inline_query_result_contact.id assert inline_query_result_contact_dict['id'] == inline_query_result_contact.id
assert inline_query_result_contact_dict['type'] == inline_query_result_contact.type assert inline_query_result_contact_dict['type'] == inline_query_result_contact.type
assert (inline_query_result_contact_dict['phone_number'] == assert (inline_query_result_contact_dict['phone_number']
inline_query_result_contact.phone_number) == inline_query_result_contact.phone_number)
assert (inline_query_result_contact_dict['first_name'] == assert (inline_query_result_contact_dict['first_name']
inline_query_result_contact.first_name) == inline_query_result_contact.first_name)
assert (inline_query_result_contact_dict['last_name'] == assert (inline_query_result_contact_dict['last_name']
inline_query_result_contact.last_name) == inline_query_result_contact.last_name)
assert (inline_query_result_contact_dict['thumb_url'] == assert (inline_query_result_contact_dict['thumb_url']
inline_query_result_contact.thumb_url) == inline_query_result_contact.thumb_url)
assert (inline_query_result_contact_dict['thumb_width'] == assert (inline_query_result_contact_dict['thumb_width']
inline_query_result_contact.thumb_width) == inline_query_result_contact.thumb_width)
assert (inline_query_result_contact_dict['thumb_height'] == assert (inline_query_result_contact_dict['thumb_height']
inline_query_result_contact.thumb_height) == inline_query_result_contact.thumb_height)
assert (inline_query_result_contact_dict['input_message_content'] == assert (inline_query_result_contact_dict['input_message_content']
inline_query_result_contact.input_message_content.to_dict()) == inline_query_result_contact.input_message_content.to_dict())
assert (inline_query_result_contact_dict['reply_markup'] == assert (inline_query_result_contact_dict['reply_markup']
inline_query_result_contact.reply_markup.to_dict()) == inline_query_result_contact.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultContact(self.id, self.phone_number, self.first_name) a = InlineQueryResultContact(self.id, self.phone_number, self.first_name)

View file

@ -67,8 +67,8 @@ class TestInlineQueryResultDocument(object):
assert inline_query_result_document.thumb_url == self.thumb_url assert inline_query_result_document.thumb_url == self.thumb_url
assert inline_query_result_document.thumb_width == self.thumb_width assert inline_query_result_document.thumb_width == self.thumb_width
assert inline_query_result_document.thumb_height == self.thumb_height assert inline_query_result_document.thumb_height == self.thumb_height
assert (inline_query_result_document.input_message_content.to_dict() == assert (inline_query_result_document.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_document.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_document.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_document): def test_to_dict(self, inline_query_result_document):
@ -77,26 +77,26 @@ class TestInlineQueryResultDocument(object):
assert isinstance(inline_query_result_document_dict, dict) assert isinstance(inline_query_result_document_dict, dict)
assert inline_query_result_document_dict['id'] == inline_query_result_document.id assert inline_query_result_document_dict['id'] == inline_query_result_document.id
assert inline_query_result_document_dict['type'] == inline_query_result_document.type assert inline_query_result_document_dict['type'] == inline_query_result_document.type
assert (inline_query_result_document_dict['document_url'] == assert (inline_query_result_document_dict['document_url']
inline_query_result_document.document_url) == inline_query_result_document.document_url)
assert inline_query_result_document_dict['title'] == inline_query_result_document.title assert inline_query_result_document_dict['title'] == inline_query_result_document.title
assert inline_query_result_document_dict['caption'] == inline_query_result_document.caption assert inline_query_result_document_dict['caption'] == inline_query_result_document.caption
assert (inline_query_result_document_dict['parse_mode'] == assert (inline_query_result_document_dict['parse_mode']
inline_query_result_document.parse_mode) == inline_query_result_document.parse_mode)
assert (inline_query_result_document_dict['mime_type'] == assert (inline_query_result_document_dict['mime_type']
inline_query_result_document.mime_type) == inline_query_result_document.mime_type)
assert (inline_query_result_document_dict['description'] == assert (inline_query_result_document_dict['description']
inline_query_result_document.description) == inline_query_result_document.description)
assert (inline_query_result_document_dict['thumb_url'] == assert (inline_query_result_document_dict['thumb_url']
inline_query_result_document.thumb_url) == inline_query_result_document.thumb_url)
assert (inline_query_result_document_dict['thumb_width'] == assert (inline_query_result_document_dict['thumb_width']
inline_query_result_document.thumb_width) == inline_query_result_document.thumb_width)
assert (inline_query_result_document_dict['thumb_height'] == assert (inline_query_result_document_dict['thumb_height']
inline_query_result_document.thumb_height) == inline_query_result_document.thumb_height)
assert (inline_query_result_document_dict['input_message_content'] == assert (inline_query_result_document_dict['input_message_content']
inline_query_result_document.input_message_content.to_dict()) == inline_query_result_document.input_message_content.to_dict())
assert (inline_query_result_document_dict['reply_markup'] == assert (inline_query_result_document_dict['reply_markup']
inline_query_result_document.reply_markup.to_dict()) == inline_query_result_document.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultDocument(self.id, self.document_url, self.title, a = InlineQueryResultDocument(self.id, self.document_url, self.title,

View file

@ -40,8 +40,8 @@ class TestInlineQueryResultGame(object):
assert inline_query_result_game.type == self.type assert inline_query_result_game.type == self.type
assert inline_query_result_game.id == self.id assert inline_query_result_game.id == self.id
assert inline_query_result_game.game_short_name == self.game_short_name assert inline_query_result_game.game_short_name == self.game_short_name
assert (inline_query_result_game.reply_markup.to_dict() == assert (inline_query_result_game.reply_markup.to_dict()
self.reply_markup.to_dict()) == self.reply_markup.to_dict())
def test_to_dict(self, inline_query_result_game): def test_to_dict(self, inline_query_result_game):
inline_query_result_game_dict = inline_query_result_game.to_dict() inline_query_result_game_dict = inline_query_result_game.to_dict()
@ -49,10 +49,10 @@ class TestInlineQueryResultGame(object):
assert isinstance(inline_query_result_game_dict, dict) assert isinstance(inline_query_result_game_dict, dict)
assert inline_query_result_game_dict['type'] == inline_query_result_game.type assert inline_query_result_game_dict['type'] == inline_query_result_game.type
assert inline_query_result_game_dict['id'] == inline_query_result_game.id assert inline_query_result_game_dict['id'] == inline_query_result_game.id
assert (inline_query_result_game_dict['game_short_name'] == assert (inline_query_result_game_dict['game_short_name']
inline_query_result_game.game_short_name) == inline_query_result_game.game_short_name)
assert (inline_query_result_game_dict['reply_markup'] == assert (inline_query_result_game_dict['reply_markup']
inline_query_result_game.reply_markup.to_dict()) == inline_query_result_game.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultGame(self.id, self.game_short_name) a = InlineQueryResultGame(self.id, self.game_short_name)

View file

@ -64,8 +64,8 @@ class TestInlineQueryResultGif(object):
assert inline_query_result_gif.title == self.title assert inline_query_result_gif.title == self.title
assert inline_query_result_gif.caption == self.caption assert inline_query_result_gif.caption == self.caption
assert inline_query_result_gif.parse_mode == self.parse_mode assert inline_query_result_gif.parse_mode == self.parse_mode
assert (inline_query_result_gif.input_message_content.to_dict() == assert (inline_query_result_gif.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_gif.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_gif.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_gif): def test_to_dict(self, inline_query_result_gif):
@ -82,10 +82,10 @@ class TestInlineQueryResultGif(object):
assert inline_query_result_gif_dict['title'] == inline_query_result_gif.title assert inline_query_result_gif_dict['title'] == inline_query_result_gif.title
assert inline_query_result_gif_dict['caption'] == inline_query_result_gif.caption assert inline_query_result_gif_dict['caption'] == inline_query_result_gif.caption
assert inline_query_result_gif_dict['parse_mode'] == inline_query_result_gif.parse_mode assert inline_query_result_gif_dict['parse_mode'] == inline_query_result_gif.parse_mode
assert (inline_query_result_gif_dict['input_message_content'] == assert (inline_query_result_gif_dict['input_message_content']
inline_query_result_gif.input_message_content.to_dict()) == inline_query_result_gif.input_message_content.to_dict())
assert (inline_query_result_gif_dict['reply_markup'] == assert (inline_query_result_gif_dict['reply_markup']
inline_query_result_gif.reply_markup.to_dict()) == inline_query_result_gif.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultGif(self.id, self.gif_url, self.thumb_url) a = InlineQueryResultGif(self.id, self.gif_url, self.thumb_url)

View file

@ -61,8 +61,8 @@ class TestInlineQueryResultLocation(object):
assert inline_query_result_location.thumb_url == self.thumb_url assert inline_query_result_location.thumb_url == self.thumb_url
assert inline_query_result_location.thumb_width == self.thumb_width assert inline_query_result_location.thumb_width == self.thumb_width
assert inline_query_result_location.thumb_height == self.thumb_height assert inline_query_result_location.thumb_height == self.thumb_height
assert (inline_query_result_location.input_message_content.to_dict() == assert (inline_query_result_location.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_location.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_location.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_location): def test_to_dict(self, inline_query_result_location):
@ -71,23 +71,23 @@ class TestInlineQueryResultLocation(object):
assert isinstance(inline_query_result_location_dict, dict) assert isinstance(inline_query_result_location_dict, dict)
assert inline_query_result_location_dict['id'] == inline_query_result_location.id assert inline_query_result_location_dict['id'] == inline_query_result_location.id
assert inline_query_result_location_dict['type'] == inline_query_result_location.type assert inline_query_result_location_dict['type'] == inline_query_result_location.type
assert (inline_query_result_location_dict['latitude'] == assert (inline_query_result_location_dict['latitude']
inline_query_result_location.latitude) == inline_query_result_location.latitude)
assert (inline_query_result_location_dict['longitude'] == assert (inline_query_result_location_dict['longitude']
inline_query_result_location.longitude) == inline_query_result_location.longitude)
assert inline_query_result_location_dict['title'] == inline_query_result_location.title assert inline_query_result_location_dict['title'] == inline_query_result_location.title
assert (inline_query_result_location_dict['live_period'] == assert (inline_query_result_location_dict['live_period']
inline_query_result_location.live_period) == inline_query_result_location.live_period)
assert (inline_query_result_location_dict['thumb_url'] == assert (inline_query_result_location_dict['thumb_url']
inline_query_result_location.thumb_url) == inline_query_result_location.thumb_url)
assert (inline_query_result_location_dict['thumb_width'] == assert (inline_query_result_location_dict['thumb_width']
inline_query_result_location.thumb_width) == inline_query_result_location.thumb_width)
assert (inline_query_result_location_dict['thumb_height'] == assert (inline_query_result_location_dict['thumb_height']
inline_query_result_location.thumb_height) == inline_query_result_location.thumb_height)
assert (inline_query_result_location_dict['input_message_content'] == assert (inline_query_result_location_dict['input_message_content']
inline_query_result_location.input_message_content.to_dict()) == inline_query_result_location.input_message_content.to_dict())
assert (inline_query_result_location_dict['reply_markup'] == assert (inline_query_result_location_dict['reply_markup']
inline_query_result_location.reply_markup.to_dict()) == inline_query_result_location.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultLocation(self.id, self.longitude, self.latitude, self.title) a = InlineQueryResultLocation(self.id, self.longitude, self.latitude, self.title)

View file

@ -64,8 +64,8 @@ class TestInlineQueryResultMpeg4Gif(object):
assert inline_query_result_mpeg4_gif.title == self.title assert inline_query_result_mpeg4_gif.title == self.title
assert inline_query_result_mpeg4_gif.caption == self.caption assert inline_query_result_mpeg4_gif.caption == self.caption
assert inline_query_result_mpeg4_gif.parse_mode == self.parse_mode assert inline_query_result_mpeg4_gif.parse_mode == self.parse_mode
assert (inline_query_result_mpeg4_gif.input_message_content.to_dict() == assert (inline_query_result_mpeg4_gif.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_mpeg4_gif.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_mpeg4_gif.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_mpeg4_gif): def test_to_dict(self, inline_query_result_mpeg4_gif):
@ -74,25 +74,25 @@ class TestInlineQueryResultMpeg4Gif(object):
assert isinstance(inline_query_result_mpeg4_gif_dict, dict) assert isinstance(inline_query_result_mpeg4_gif_dict, dict)
assert inline_query_result_mpeg4_gif_dict['type'] == inline_query_result_mpeg4_gif.type assert inline_query_result_mpeg4_gif_dict['type'] == inline_query_result_mpeg4_gif.type
assert inline_query_result_mpeg4_gif_dict['id'] == inline_query_result_mpeg4_gif.id assert inline_query_result_mpeg4_gif_dict['id'] == inline_query_result_mpeg4_gif.id
assert (inline_query_result_mpeg4_gif_dict['mpeg4_url'] == assert (inline_query_result_mpeg4_gif_dict['mpeg4_url']
inline_query_result_mpeg4_gif.mpeg4_url) == inline_query_result_mpeg4_gif.mpeg4_url)
assert (inline_query_result_mpeg4_gif_dict['mpeg4_width'] == assert (inline_query_result_mpeg4_gif_dict['mpeg4_width']
inline_query_result_mpeg4_gif.mpeg4_width) == inline_query_result_mpeg4_gif.mpeg4_width)
assert (inline_query_result_mpeg4_gif_dict['mpeg4_height'] == assert (inline_query_result_mpeg4_gif_dict['mpeg4_height']
inline_query_result_mpeg4_gif.mpeg4_height) == inline_query_result_mpeg4_gif.mpeg4_height)
assert (inline_query_result_mpeg4_gif_dict['mpeg4_duration'] == assert (inline_query_result_mpeg4_gif_dict['mpeg4_duration']
inline_query_result_mpeg4_gif.mpeg4_duration) == inline_query_result_mpeg4_gif.mpeg4_duration)
assert (inline_query_result_mpeg4_gif_dict['thumb_url'] == assert (inline_query_result_mpeg4_gif_dict['thumb_url']
inline_query_result_mpeg4_gif.thumb_url) == inline_query_result_mpeg4_gif.thumb_url)
assert inline_query_result_mpeg4_gif_dict['title'] == inline_query_result_mpeg4_gif.title assert inline_query_result_mpeg4_gif_dict['title'] == inline_query_result_mpeg4_gif.title
assert (inline_query_result_mpeg4_gif_dict['caption'] == assert (inline_query_result_mpeg4_gif_dict['caption']
inline_query_result_mpeg4_gif.caption) == inline_query_result_mpeg4_gif.caption)
assert (inline_query_result_mpeg4_gif_dict['parse_mode'] == assert (inline_query_result_mpeg4_gif_dict['parse_mode']
inline_query_result_mpeg4_gif.parse_mode) == inline_query_result_mpeg4_gif.parse_mode)
assert (inline_query_result_mpeg4_gif_dict['input_message_content'] == assert (inline_query_result_mpeg4_gif_dict['input_message_content']
inline_query_result_mpeg4_gif.input_message_content.to_dict()) == inline_query_result_mpeg4_gif.input_message_content.to_dict())
assert (inline_query_result_mpeg4_gif_dict['reply_markup'] == assert (inline_query_result_mpeg4_gif_dict['reply_markup']
inline_query_result_mpeg4_gif.reply_markup.to_dict()) == inline_query_result_mpeg4_gif.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultMpeg4Gif(self.id, self.mpeg4_url, self.thumb_url) a = InlineQueryResultMpeg4Gif(self.id, self.mpeg4_url, self.thumb_url)

View file

@ -64,8 +64,8 @@ class TestInlineQueryResultPhoto(object):
assert inline_query_result_photo.description == self.description assert inline_query_result_photo.description == self.description
assert inline_query_result_photo.caption == self.caption assert inline_query_result_photo.caption == self.caption
assert inline_query_result_photo.parse_mode == self.parse_mode assert inline_query_result_photo.parse_mode == self.parse_mode
assert (inline_query_result_photo.input_message_content.to_dict() == assert (inline_query_result_photo.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_photo.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_photo.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_photo): def test_to_dict(self, inline_query_result_photo):
@ -75,20 +75,20 @@ class TestInlineQueryResultPhoto(object):
assert inline_query_result_photo_dict['type'] == inline_query_result_photo.type assert inline_query_result_photo_dict['type'] == inline_query_result_photo.type
assert inline_query_result_photo_dict['id'] == inline_query_result_photo.id assert inline_query_result_photo_dict['id'] == inline_query_result_photo.id
assert inline_query_result_photo_dict['photo_url'] == inline_query_result_photo.photo_url assert inline_query_result_photo_dict['photo_url'] == inline_query_result_photo.photo_url
assert (inline_query_result_photo_dict['photo_width'] == assert (inline_query_result_photo_dict['photo_width']
inline_query_result_photo.photo_width) == inline_query_result_photo.photo_width)
assert (inline_query_result_photo_dict['photo_height'] == assert (inline_query_result_photo_dict['photo_height']
inline_query_result_photo.photo_height) == inline_query_result_photo.photo_height)
assert inline_query_result_photo_dict['thumb_url'] == inline_query_result_photo.thumb_url assert inline_query_result_photo_dict['thumb_url'] == inline_query_result_photo.thumb_url
assert inline_query_result_photo_dict['title'] == inline_query_result_photo.title assert inline_query_result_photo_dict['title'] == inline_query_result_photo.title
assert (inline_query_result_photo_dict['description'] == assert (inline_query_result_photo_dict['description']
inline_query_result_photo.description) == inline_query_result_photo.description)
assert inline_query_result_photo_dict['caption'] == inline_query_result_photo.caption assert inline_query_result_photo_dict['caption'] == inline_query_result_photo.caption
assert inline_query_result_photo_dict['parse_mode'] == inline_query_result_photo.parse_mode assert inline_query_result_photo_dict['parse_mode'] == inline_query_result_photo.parse_mode
assert (inline_query_result_photo_dict['input_message_content'] == assert (inline_query_result_photo_dict['input_message_content']
inline_query_result_photo.input_message_content.to_dict()) == inline_query_result_photo.input_message_content.to_dict())
assert (inline_query_result_photo_dict['reply_markup'] == assert (inline_query_result_photo_dict['reply_markup']
inline_query_result_photo.reply_markup.to_dict()) == inline_query_result_photo.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultPhoto(self.id, self.photo_url, self.thumb_url) a = InlineQueryResultPhoto(self.id, self.photo_url, self.thumb_url)

View file

@ -67,8 +67,8 @@ class TestInlineQueryResultVenue(object):
assert inline_query_result_venue.thumb_url == self.thumb_url assert inline_query_result_venue.thumb_url == self.thumb_url
assert inline_query_result_venue.thumb_width == self.thumb_width assert inline_query_result_venue.thumb_width == self.thumb_width
assert inline_query_result_venue.thumb_height == self.thumb_height assert inline_query_result_venue.thumb_height == self.thumb_height
assert (inline_query_result_venue.input_message_content.to_dict() == assert (inline_query_result_venue.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_venue.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_venue.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_venue): def test_to_dict(self, inline_query_result_venue):
@ -81,19 +81,19 @@ class TestInlineQueryResultVenue(object):
assert inline_query_result_venue_dict['longitude'] == inline_query_result_venue.longitude assert inline_query_result_venue_dict['longitude'] == inline_query_result_venue.longitude
assert inline_query_result_venue_dict['title'] == inline_query_result_venue.title assert inline_query_result_venue_dict['title'] == inline_query_result_venue.title
assert inline_query_result_venue_dict['address'] == inline_query_result_venue.address assert inline_query_result_venue_dict['address'] == inline_query_result_venue.address
assert (inline_query_result_venue_dict['foursquare_id'] == assert (inline_query_result_venue_dict['foursquare_id']
inline_query_result_venue.foursquare_id) == inline_query_result_venue.foursquare_id)
assert (inline_query_result_venue_dict['foursquare_type'] == assert (inline_query_result_venue_dict['foursquare_type']
inline_query_result_venue.foursquare_type) == inline_query_result_venue.foursquare_type)
assert inline_query_result_venue_dict['thumb_url'] == inline_query_result_venue.thumb_url assert inline_query_result_venue_dict['thumb_url'] == inline_query_result_venue.thumb_url
assert (inline_query_result_venue_dict['thumb_width'] == assert (inline_query_result_venue_dict['thumb_width']
inline_query_result_venue.thumb_width) == inline_query_result_venue.thumb_width)
assert (inline_query_result_venue_dict['thumb_height'] == assert (inline_query_result_venue_dict['thumb_height']
inline_query_result_venue.thumb_height) == inline_query_result_venue.thumb_height)
assert (inline_query_result_venue_dict['input_message_content'] == assert (inline_query_result_venue_dict['input_message_content']
inline_query_result_venue.input_message_content.to_dict()) == inline_query_result_venue.input_message_content.to_dict())
assert (inline_query_result_venue_dict['reply_markup'] == assert (inline_query_result_venue_dict['reply_markup']
inline_query_result_venue.reply_markup.to_dict()) == inline_query_result_venue.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultVenue(self.id, self.longitude, self.latitude, self.title, a = InlineQueryResultVenue(self.id, self.longitude, self.latitude, self.title,

View file

@ -70,8 +70,8 @@ class TestInlineQueryResultVideo(object):
assert inline_query_result_video.description == self.description assert inline_query_result_video.description == self.description
assert inline_query_result_video.caption == self.caption assert inline_query_result_video.caption == self.caption
assert inline_query_result_video.parse_mode == self.parse_mode assert inline_query_result_video.parse_mode == self.parse_mode
assert (inline_query_result_video.input_message_content.to_dict() == assert (inline_query_result_video.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_video.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_video.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_video): def test_to_dict(self, inline_query_result_video):
@ -82,22 +82,22 @@ class TestInlineQueryResultVideo(object):
assert inline_query_result_video_dict['id'] == inline_query_result_video.id assert inline_query_result_video_dict['id'] == inline_query_result_video.id
assert inline_query_result_video_dict['video_url'] == inline_query_result_video.video_url assert inline_query_result_video_dict['video_url'] == inline_query_result_video.video_url
assert inline_query_result_video_dict['mime_type'] == inline_query_result_video.mime_type assert inline_query_result_video_dict['mime_type'] == inline_query_result_video.mime_type
assert (inline_query_result_video_dict['video_width'] == assert (inline_query_result_video_dict['video_width']
inline_query_result_video.video_width) == inline_query_result_video.video_width)
assert (inline_query_result_video_dict['video_height'] == assert (inline_query_result_video_dict['video_height']
inline_query_result_video.video_height) == inline_query_result_video.video_height)
assert (inline_query_result_video_dict['video_duration'] == assert (inline_query_result_video_dict['video_duration']
inline_query_result_video.video_duration) == inline_query_result_video.video_duration)
assert inline_query_result_video_dict['thumb_url'] == inline_query_result_video.thumb_url assert inline_query_result_video_dict['thumb_url'] == inline_query_result_video.thumb_url
assert inline_query_result_video_dict['title'] == inline_query_result_video.title assert inline_query_result_video_dict['title'] == inline_query_result_video.title
assert (inline_query_result_video_dict['description'] == assert (inline_query_result_video_dict['description']
inline_query_result_video.description) == inline_query_result_video.description)
assert inline_query_result_video_dict['caption'] == inline_query_result_video.caption assert inline_query_result_video_dict['caption'] == inline_query_result_video.caption
assert inline_query_result_video_dict['parse_mode'] == inline_query_result_video.parse_mode assert inline_query_result_video_dict['parse_mode'] == inline_query_result_video.parse_mode
assert (inline_query_result_video_dict['input_message_content'] == assert (inline_query_result_video_dict['input_message_content']
inline_query_result_video.input_message_content.to_dict()) == inline_query_result_video.input_message_content.to_dict())
assert (inline_query_result_video_dict['reply_markup'] == assert (inline_query_result_video_dict['reply_markup']
inline_query_result_video.reply_markup.to_dict()) == inline_query_result_video.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultVideo(self.id, self.video_url, self.mime_type, a = InlineQueryResultVideo(self.id, self.video_url, self.mime_type,

View file

@ -56,8 +56,8 @@ class TestInlineQueryResultVoice(object):
assert inline_query_result_voice.voice_duration == self.voice_duration assert inline_query_result_voice.voice_duration == self.voice_duration
assert inline_query_result_voice.caption == self.caption assert inline_query_result_voice.caption == self.caption
assert inline_query_result_voice.parse_mode == self.parse_mode assert inline_query_result_voice.parse_mode == self.parse_mode
assert (inline_query_result_voice.input_message_content.to_dict() == assert (inline_query_result_voice.input_message_content.to_dict()
self.input_message_content.to_dict()) == self.input_message_content.to_dict())
assert inline_query_result_voice.reply_markup.to_dict() == self.reply_markup.to_dict() assert inline_query_result_voice.reply_markup.to_dict() == self.reply_markup.to_dict()
def test_to_dict(self, inline_query_result_voice): def test_to_dict(self, inline_query_result_voice):
@ -68,14 +68,14 @@ class TestInlineQueryResultVoice(object):
assert inline_query_result_voice_dict['id'] == inline_query_result_voice.id assert inline_query_result_voice_dict['id'] == inline_query_result_voice.id
assert inline_query_result_voice_dict['voice_url'] == inline_query_result_voice.voice_url assert inline_query_result_voice_dict['voice_url'] == inline_query_result_voice.voice_url
assert inline_query_result_voice_dict['title'] == inline_query_result_voice.title assert inline_query_result_voice_dict['title'] == inline_query_result_voice.title
assert (inline_query_result_voice_dict['voice_duration'] == assert (inline_query_result_voice_dict['voice_duration']
inline_query_result_voice.voice_duration) == inline_query_result_voice.voice_duration)
assert inline_query_result_voice_dict['caption'] == inline_query_result_voice.caption assert inline_query_result_voice_dict['caption'] == inline_query_result_voice.caption
assert inline_query_result_voice_dict['parse_mode'] == inline_query_result_voice.parse_mode assert inline_query_result_voice_dict['parse_mode'] == inline_query_result_voice.parse_mode
assert (inline_query_result_voice_dict['input_message_content'] == assert (inline_query_result_voice_dict['input_message_content']
inline_query_result_voice.input_message_content.to_dict()) == inline_query_result_voice.input_message_content.to_dict())
assert (inline_query_result_voice_dict['reply_markup'] == assert (inline_query_result_voice_dict['reply_markup']
inline_query_result_voice.reply_markup.to_dict()) == inline_query_result_voice.reply_markup.to_dict())
def test_equality(self): def test_equality(self):
a = InlineQueryResultVoice(self.id, self.voice_url, self.title) a = InlineQueryResultVoice(self.id, self.voice_url, self.title)

View file

@ -43,9 +43,9 @@ class TestInputContactMessageContent(object):
input_contact_message_content_dict = input_contact_message_content.to_dict() input_contact_message_content_dict = input_contact_message_content.to_dict()
assert isinstance(input_contact_message_content_dict, dict) assert isinstance(input_contact_message_content_dict, dict)
assert (input_contact_message_content_dict['phone_number'] == assert (input_contact_message_content_dict['phone_number']
input_contact_message_content.phone_number) == input_contact_message_content.phone_number)
assert (input_contact_message_content_dict['first_name'] == assert (input_contact_message_content_dict['first_name']
input_contact_message_content.first_name) == input_contact_message_content.first_name)
assert (input_contact_message_content_dict['last_name'] == assert (input_contact_message_content_dict['last_name']
input_contact_message_content.last_name) == input_contact_message_content.last_name)

View file

@ -60,8 +60,8 @@ class TestInputFile(object):
assert InputFile(BytesIO(b'blah'), filename='tg.mp3').mimetype == 'audio/mpeg' assert InputFile(BytesIO(b'blah'), filename='tg.mp3').mimetype == 'audio/mpeg'
# Test fallback # Test fallback
assert (InputFile(BytesIO(b'blah'), filename='tg.notaproperext').mimetype == assert (InputFile(BytesIO(b'blah'), filename='tg.notaproperext').mimetype
'application/octet-stream') == 'application/octet-stream')
assert InputFile(BytesIO(b'blah')).mimetype == 'application/octet-stream' assert InputFile(BytesIO(b'blah')).mimetype == 'application/octet-stream'
def test_filenames(self): def test_filenames(self):
@ -89,7 +89,8 @@ class TestInputFile(object):
filename='blah').filename == 'blah' filename='blah').filename == 'blah'
assert InputFile(MockedFileobject('tests/data/telegram.jpg'), assert InputFile(MockedFileobject('tests/data/telegram.jpg'),
filename='blah.jpg').filename == 'blah.jpg' filename='blah.jpg').filename == 'blah.jpg'
assert InputFile(MockedFileobject('tests/data/telegram')).filename == 'application.octet-stream' # flake8: noqa assert InputFile(
MockedFileobject('tests/data/telegram')).filename == 'application.octet-stream'
assert InputFile(MockedFileobject('tests/data/telegram'), assert InputFile(MockedFileobject('tests/data/telegram'),
filename='blah').filename == 'blah' filename='blah').filename == 'blah'
assert InputFile(MockedFileobject('tests/data/telegram'), assert InputFile(MockedFileobject('tests/data/telegram'),

View file

@ -43,9 +43,9 @@ class TestInputLocationMessageContent(object):
input_location_message_content_dict = input_location_message_content.to_dict() input_location_message_content_dict = input_location_message_content.to_dict()
assert isinstance(input_location_message_content_dict, dict) assert isinstance(input_location_message_content_dict, dict)
assert (input_location_message_content_dict['latitude'] == assert (input_location_message_content_dict['latitude']
input_location_message_content.latitude) == input_location_message_content.latitude)
assert (input_location_message_content_dict['longitude'] == assert (input_location_message_content_dict['longitude']
input_location_message_content.longitude) == input_location_message_content.longitude)
assert (input_location_message_content_dict['live_period'] == assert (input_location_message_content_dict['live_period']
input_location_message_content.live_period) == input_location_message_content.live_period)

View file

@ -44,9 +44,9 @@ class TestInputTextMessageContent(object):
input_text_message_content_dict = input_text_message_content.to_dict() input_text_message_content_dict = input_text_message_content.to_dict()
assert isinstance(input_text_message_content_dict, dict) assert isinstance(input_text_message_content_dict, dict)
assert (input_text_message_content_dict['message_text'] == assert (input_text_message_content_dict['message_text']
input_text_message_content.message_text) == input_text_message_content.message_text)
assert (input_text_message_content_dict['parse_mode'] == assert (input_text_message_content_dict['parse_mode']
input_text_message_content.parse_mode) == input_text_message_content.parse_mode)
assert (input_text_message_content_dict['disable_web_page_preview'] == assert (input_text_message_content_dict['disable_web_page_preview']
input_text_message_content.disable_web_page_preview) == input_text_message_content.disable_web_page_preview)

View file

@ -52,13 +52,13 @@ class TestInputVenueMessageContent(object):
input_venue_message_content_dict = input_venue_message_content.to_dict() input_venue_message_content_dict = input_venue_message_content.to_dict()
assert isinstance(input_venue_message_content_dict, dict) assert isinstance(input_venue_message_content_dict, dict)
assert (input_venue_message_content_dict['latitude'] == assert (input_venue_message_content_dict['latitude']
input_venue_message_content.latitude) == input_venue_message_content.latitude)
assert (input_venue_message_content_dict['longitude'] == assert (input_venue_message_content_dict['longitude']
input_venue_message_content.longitude) == input_venue_message_content.longitude)
assert input_venue_message_content_dict['title'] == input_venue_message_content.title assert input_venue_message_content_dict['title'] == input_venue_message_content.title
assert input_venue_message_content_dict['address'] == input_venue_message_content.address assert input_venue_message_content_dict['address'] == input_venue_message_content.address
assert (input_venue_message_content_dict['foursquare_id'] == assert (input_venue_message_content_dict['foursquare_id']
input_venue_message_content.foursquare_id) == input_venue_message_content.foursquare_id)
assert (input_venue_message_content_dict['foursquare_type'] == assert (input_venue_message_content_dict['foursquare_type']
input_venue_message_content.foursquare_type) == input_venue_message_content.foursquare_type)

View file

@ -112,8 +112,8 @@ class TestInvoice(object):
def test_send_object_as_provider_data(self, monkeypatch, bot, chat_id, provider_token): def test_send_object_as_provider_data(self, monkeypatch, bot, chat_id, provider_token):
def test(_, url, data, **kwargs): def test(_, url, data, **kwargs):
return (data['provider_data'] == '{"test_data": 123456789}' or # Depends if using return (data['provider_data'] == '{"test_data": 123456789}' # Depends if using
data['provider_data'] == '{"test_data":123456789}') # ujson or not or data['provider_data'] == '{"test_data":123456789}') # ujson or not
monkeypatch.setattr('telegram.utils.request.Request.post', test) monkeypatch.setattr('telegram.utils.request.Request.post', test)

View file

@ -115,7 +115,7 @@ class TestMessage(object):
{'length': 4, 'offset': 25, 'type': 'code'}, {'length': 4, 'offset': 25, 'type': 'code'},
{'length': 5, 'offset': 31, 'type': 'text_link', 'url': 'http://github.com/'}, {'length': 5, 'offset': 31, 'type': 'text_link', 'url': 'http://github.com/'},
{'length': 12, 'offset': 38, 'type': 'text_mention', {'length': 12, 'offset': 38, 'type': 'text_mention',
'user': User(123456789, 'mentioned user', False)}, 'user': User(123456789, 'mentioned user', False)},
{'length': 3, 'offset': 55, 'type': 'pre'}, {'length': 3, 'offset': 55, 'type': 'pre'},
{'length': 17, 'offset': 60, 'type': 'url'}] {'length': 17, 'offset': 60, 'type': 'url'}]
test_text = 'Test for <bold, ita_lic, code, links, text-mention and pre. http://google.com' test_text = 'Test for <bold, ita_lic, code, links, text-mention and pre. http://google.com'
@ -195,7 +195,7 @@ class TestMessage(object):
assert text_html == test_html_string assert text_html == test_html_string
def test_text_markdown_simple(self): def test_text_markdown_simple(self):
test_md_string = ('Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), ' test_md_string = (r'Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), '
'[text-mention](tg://user?id=123456789) and ```pre```. ' '[text-mention](tg://user?id=123456789) and ```pre```. '
'http://google.com') 'http://google.com')
text_markdown = self.test_message.text_markdown text_markdown = self.test_message.text_markdown
@ -207,7 +207,7 @@ class TestMessage(object):
assert message.text_markdown is None assert message.text_markdown is None
def test_text_markdown_urled(self): def test_text_markdown_urled(self):
test_md_string = ('Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), ' test_md_string = (r'Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), '
'[text-mention](tg://user?id=123456789) and ```pre```. ' '[text-mention](tg://user?id=123456789) and ```pre```. '
'[http://google.com](http://google.com)') '[http://google.com](http://google.com)')
text_markdown = self.test_message.text_markdown_urled text_markdown = self.test_message.text_markdown_urled
@ -251,7 +251,7 @@ class TestMessage(object):
assert caption_html == test_html_string assert caption_html == test_html_string
def test_caption_markdown_simple(self): def test_caption_markdown_simple(self):
test_md_string = ('Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), ' test_md_string = (r'Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), '
'[text-mention](tg://user?id=123456789) and ```pre```. ' '[text-mention](tg://user?id=123456789) and ```pre```. '
'http://google.com') 'http://google.com')
caption_markdown = self.test_message.caption_markdown caption_markdown = self.test_message.caption_markdown
@ -263,7 +263,7 @@ class TestMessage(object):
assert message.caption_markdown is None assert message.caption_markdown is None
def test_caption_markdown_urled(self): def test_caption_markdown_urled(self):
test_md_string = ('Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), ' test_md_string = (r'Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), '
'[text-mention](tg://user?id=123456789) and ```pre```. ' '[text-mention](tg://user?id=123456789) and ```pre```. '
'[http://google.com](http://google.com)') '[http://google.com](http://google.com)')
caption_markdown = self.test_message.caption_markdown_urled caption_markdown = self.test_message.caption_markdown_urled
@ -336,7 +336,7 @@ class TestMessage(object):
assert message.reply_text('test', reply_to_message_id=message.message_id, quote=True) assert message.reply_text('test', reply_to_message_id=message.message_id, quote=True)
def test_reply_markdown(self, monkeypatch, message): def test_reply_markdown(self, monkeypatch, message):
test_md_string = ('Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), ' test_md_string = (r'Test for <*bold*, _ita\_lic_, `code`, [links](http://github.com/), '
'[text-mention](tg://user?id=123456789) and ```pre```. ' '[text-mention](tg://user?id=123456789) and ```pre```. '
'http://google.com') 'http://google.com')

View file

@ -45,9 +45,8 @@ class TestDelayQueue(object):
dsp(self.call) dsp(self.call)
starttime = mq.curtime() starttime = mq.curtime()
app_endtime = ( # wait up to 20 sec more than needed
(self.N * self.burst_limit / app_endtime = ((self.N * self.burst_limit / (1000 * self.time_limit_ms)) + starttime + 20)
(1000 * self.time_limit_ms)) + starttime + 20) # wait up to 20 sec more than needed
while not dsp._queue.empty() and mq.curtime() < app_endtime: while not dsp._queue.empty() and mq.curtime() < app_endtime:
sleep(1) sleep(1)
assert dsp._queue.empty() is True # check loop exit condition assert dsp._queue.empty() is True # check loop exit condition

View file

@ -96,8 +96,8 @@ def check_object(h4):
field = parameter[0] field = parameter[0]
if field == 'from': if field == 'from':
field = 'from_user' field = 'from_user'
elif ((name.startswith('InlineQueryResult') or elif ((name.startswith('InlineQueryResult')
name.startswith('InputMedia')) and field == 'type'): or name.startswith('InputMedia')) and field == 'type'):
continue continue
elif name.startswith('PassportElementError') and field == 'source': elif name.startswith('PassportElementError') and field == 'source':
continue continue

View file

@ -48,16 +48,16 @@ class TestPassportElementErrorDataField(object):
passport_element_error_data_field_dict = passport_element_error_data_field.to_dict() passport_element_error_data_field_dict = passport_element_error_data_field.to_dict()
assert isinstance(passport_element_error_data_field_dict, dict) assert isinstance(passport_element_error_data_field_dict, dict)
assert (passport_element_error_data_field_dict['source'] == assert (passport_element_error_data_field_dict['source']
passport_element_error_data_field.source) == passport_element_error_data_field.source)
assert (passport_element_error_data_field_dict['type'] == assert (passport_element_error_data_field_dict['type']
passport_element_error_data_field.type) == passport_element_error_data_field.type)
assert (passport_element_error_data_field_dict['field_name'] == assert (passport_element_error_data_field_dict['field_name']
passport_element_error_data_field.field_name) == passport_element_error_data_field.field_name)
assert (passport_element_error_data_field_dict['data_hash'] == assert (passport_element_error_data_field_dict['data_hash']
passport_element_error_data_field.data_hash) == passport_element_error_data_field.data_hash)
assert (passport_element_error_data_field_dict['message'] == assert (passport_element_error_data_field_dict['message']
passport_element_error_data_field.message) == passport_element_error_data_field.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorDataField(self.type, self.field_name, self.data_hash, self.message) a = PassportElementErrorDataField(self.type, self.field_name, self.data_hash, self.message)

View file

@ -45,14 +45,14 @@ class TestPassportElementErrorFile(object):
passport_element_error_file_dict = passport_element_error_file.to_dict() passport_element_error_file_dict = passport_element_error_file.to_dict()
assert isinstance(passport_element_error_file_dict, dict) assert isinstance(passport_element_error_file_dict, dict)
assert (passport_element_error_file_dict['source'] == assert (passport_element_error_file_dict['source']
passport_element_error_file.source) == passport_element_error_file.source)
assert (passport_element_error_file_dict['type'] == assert (passport_element_error_file_dict['type']
passport_element_error_file.type) == passport_element_error_file.type)
assert (passport_element_error_file_dict['file_hash'] == assert (passport_element_error_file_dict['file_hash']
passport_element_error_file.file_hash) == passport_element_error_file.file_hash)
assert (passport_element_error_file_dict['message'] == assert (passport_element_error_file_dict['message']
passport_element_error_file.message) == passport_element_error_file.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorFile(self.type, self.file_hash, self.message) a = PassportElementErrorFile(self.type, self.file_hash, self.message)

View file

@ -46,14 +46,14 @@ class TestPassportElementErrorFiles(object):
passport_element_error_files_dict = passport_element_error_files.to_dict() passport_element_error_files_dict = passport_element_error_files.to_dict()
assert isinstance(passport_element_error_files_dict, dict) assert isinstance(passport_element_error_files_dict, dict)
assert (passport_element_error_files_dict['source'] == assert (passport_element_error_files_dict['source']
passport_element_error_files.source) == passport_element_error_files.source)
assert (passport_element_error_files_dict['type'] == assert (passport_element_error_files_dict['type']
passport_element_error_files.type) == passport_element_error_files.type)
assert (passport_element_error_files_dict['file_hashes'] == assert (passport_element_error_files_dict['file_hashes']
passport_element_error_files.file_hashes) == passport_element_error_files.file_hashes)
assert (passport_element_error_files_dict['message'] == assert (passport_element_error_files_dict['message']
passport_element_error_files.message) == passport_element_error_files.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorFiles(self.type, self.file_hashes, self.message) a = PassportElementErrorFiles(self.type, self.file_hashes, self.message)

View file

@ -45,14 +45,14 @@ class TestPassportElementErrorFrontSide(object):
passport_element_error_front_side_dict = passport_element_error_front_side.to_dict() passport_element_error_front_side_dict = passport_element_error_front_side.to_dict()
assert isinstance(passport_element_error_front_side_dict, dict) assert isinstance(passport_element_error_front_side_dict, dict)
assert (passport_element_error_front_side_dict['source'] == assert (passport_element_error_front_side_dict['source']
passport_element_error_front_side.source) == passport_element_error_front_side.source)
assert (passport_element_error_front_side_dict['type'] == assert (passport_element_error_front_side_dict['type']
passport_element_error_front_side.type) == passport_element_error_front_side.type)
assert (passport_element_error_front_side_dict['file_hash'] == assert (passport_element_error_front_side_dict['file_hash']
passport_element_error_front_side.file_hash) == passport_element_error_front_side.file_hash)
assert (passport_element_error_front_side_dict['message'] == assert (passport_element_error_front_side_dict['message']
passport_element_error_front_side.message) == passport_element_error_front_side.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorFrontSide(self.type, self.file_hash, self.message) a = PassportElementErrorFrontSide(self.type, self.file_hash, self.message)

View file

@ -45,14 +45,14 @@ class TestPassportElementErrorReverseSide(object):
passport_element_error_reverse_side_dict = passport_element_error_reverse_side.to_dict() passport_element_error_reverse_side_dict = passport_element_error_reverse_side.to_dict()
assert isinstance(passport_element_error_reverse_side_dict, dict) assert isinstance(passport_element_error_reverse_side_dict, dict)
assert (passport_element_error_reverse_side_dict['source'] == assert (passport_element_error_reverse_side_dict['source']
passport_element_error_reverse_side.source) == passport_element_error_reverse_side.source)
assert (passport_element_error_reverse_side_dict['type'] == assert (passport_element_error_reverse_side_dict['type']
passport_element_error_reverse_side.type) == passport_element_error_reverse_side.type)
assert (passport_element_error_reverse_side_dict['file_hash'] == assert (passport_element_error_reverse_side_dict['file_hash']
passport_element_error_reverse_side.file_hash) == passport_element_error_reverse_side.file_hash)
assert (passport_element_error_reverse_side_dict['message'] == assert (passport_element_error_reverse_side_dict['message']
passport_element_error_reverse_side.message) == passport_element_error_reverse_side.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorReverseSide(self.type, self.file_hash, self.message) a = PassportElementErrorReverseSide(self.type, self.file_hash, self.message)

View file

@ -45,14 +45,14 @@ class TestPassportElementErrorSelfie(object):
passport_element_error_selfie_dict = passport_element_error_selfie.to_dict() passport_element_error_selfie_dict = passport_element_error_selfie.to_dict()
assert isinstance(passport_element_error_selfie_dict, dict) assert isinstance(passport_element_error_selfie_dict, dict)
assert (passport_element_error_selfie_dict['source'] == assert (passport_element_error_selfie_dict['source']
passport_element_error_selfie.source) == passport_element_error_selfie.source)
assert (passport_element_error_selfie_dict['type'] == assert (passport_element_error_selfie_dict['type']
passport_element_error_selfie.type) == passport_element_error_selfie.type)
assert (passport_element_error_selfie_dict['file_hash'] == assert (passport_element_error_selfie_dict['file_hash']
passport_element_error_selfie.file_hash) == passport_element_error_selfie.file_hash)
assert (passport_element_error_selfie_dict['message'] == assert (passport_element_error_selfie_dict['message']
passport_element_error_selfie.message) == passport_element_error_selfie.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorSelfie(self.type, self.file_hash, self.message) a = PassportElementErrorSelfie(self.type, self.file_hash, self.message)

View file

@ -46,14 +46,14 @@ class TestPassportElementErrorTranslationFile(object):
passport_element_error_translation_file.to_dict() passport_element_error_translation_file.to_dict()
assert isinstance(passport_element_error_translation_file_dict, dict) assert isinstance(passport_element_error_translation_file_dict, dict)
assert (passport_element_error_translation_file_dict['source'] == assert (passport_element_error_translation_file_dict['source']
passport_element_error_translation_file.source) == passport_element_error_translation_file.source)
assert (passport_element_error_translation_file_dict['type'] == assert (passport_element_error_translation_file_dict['type']
passport_element_error_translation_file.type) == passport_element_error_translation_file.type)
assert (passport_element_error_translation_file_dict['file_hash'] == assert (passport_element_error_translation_file_dict['file_hash']
passport_element_error_translation_file.file_hash) == passport_element_error_translation_file.file_hash)
assert (passport_element_error_translation_file_dict['message'] == assert (passport_element_error_translation_file_dict['message']
passport_element_error_translation_file.message) == passport_element_error_translation_file.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorTranslationFile(self.type, self.file_hash, self.message) a = PassportElementErrorTranslationFile(self.type, self.file_hash, self.message)

View file

@ -24,9 +24,10 @@ from telegram import PassportElementErrorTranslationFiles, PassportElementErrorS
@pytest.fixture(scope='class') @pytest.fixture(scope='class')
def passport_element_error_translation_files(): def passport_element_error_translation_files():
return PassportElementErrorTranslationFiles(TestPassportElementErrorTranslationFiles.type, return PassportElementErrorTranslationFiles(
TestPassportElementErrorTranslationFiles.file_hashes, # flake8: noqa TestPassportElementErrorTranslationFiles.type,
TestPassportElementErrorTranslationFiles.message) TestPassportElementErrorTranslationFiles.file_hashes,
TestPassportElementErrorTranslationFiles.message)
class TestPassportElementErrorTranslationFiles(object): class TestPassportElementErrorTranslationFiles(object):
@ -47,14 +48,14 @@ class TestPassportElementErrorTranslationFiles(object):
passport_element_error_translation_files.to_dict() passport_element_error_translation_files.to_dict()
assert isinstance(passport_element_error_translation_files_dict, dict) assert isinstance(passport_element_error_translation_files_dict, dict)
assert (passport_element_error_translation_files_dict['source'] == assert (passport_element_error_translation_files_dict['source']
passport_element_error_translation_files.source) == passport_element_error_translation_files.source)
assert (passport_element_error_translation_files_dict['type'] == assert (passport_element_error_translation_files_dict['type']
passport_element_error_translation_files.type) == passport_element_error_translation_files.type)
assert (passport_element_error_translation_files_dict['file_hashes'] == assert (passport_element_error_translation_files_dict['file_hashes']
passport_element_error_translation_files.file_hashes) == passport_element_error_translation_files.file_hashes)
assert (passport_element_error_translation_files_dict['message'] == assert (passport_element_error_translation_files_dict['message']
passport_element_error_translation_files.message) == passport_element_error_translation_files.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorTranslationFiles(self.type, self.file_hashes, self.message) a = PassportElementErrorTranslationFiles(self.type, self.file_hashes, self.message)

View file

@ -45,14 +45,14 @@ class TestPassportElementErrorUnspecified(object):
passport_element_error_unspecified_dict = passport_element_error_unspecified.to_dict() passport_element_error_unspecified_dict = passport_element_error_unspecified.to_dict()
assert isinstance(passport_element_error_unspecified_dict, dict) assert isinstance(passport_element_error_unspecified_dict, dict)
assert (passport_element_error_unspecified_dict['source'] == assert (passport_element_error_unspecified_dict['source']
passport_element_error_unspecified.source) == passport_element_error_unspecified.source)
assert (passport_element_error_unspecified_dict['type'] == assert (passport_element_error_unspecified_dict['type']
passport_element_error_unspecified.type) == passport_element_error_unspecified.type)
assert (passport_element_error_unspecified_dict['element_hash'] == assert (passport_element_error_unspecified_dict['element_hash']
passport_element_error_unspecified.element_hash) == passport_element_error_unspecified.element_hash)
assert (passport_element_error_unspecified_dict['message'] == assert (passport_element_error_unspecified_dict['message']
passport_element_error_unspecified.message) == passport_element_error_unspecified.message)
def test_equality(self): def test_equality(self):
a = PassportElementErrorUnspecified(self.type, self.element_hash, self.message) a = PassportElementErrorUnspecified(self.type, self.element_hash, self.message)

View file

@ -43,12 +43,12 @@ class TestPassportFile(object):
passport_file_dict = passport_file.to_dict() passport_file_dict = passport_file.to_dict()
assert isinstance(passport_file_dict, dict) assert isinstance(passport_file_dict, dict)
assert (passport_file_dict['file_id'] == assert (passport_file_dict['file_id']
passport_file.file_id) == passport_file.file_id)
assert (passport_file_dict['file_size'] == assert (passport_file_dict['file_size']
passport_file.file_size) == passport_file.file_size)
assert (passport_file_dict['file_date'] == assert (passport_file_dict['file_date']
passport_file.file_date) == passport_file.file_date)
def test_equality(self): def test_equality(self):
a = PassportFile(self.file_id, self.file_size, self.file_date) a = PassportFile(self.file_id, self.file_size, self.file_date)

View file

@ -69,8 +69,8 @@ class TestPreCheckoutQuery(object):
assert isinstance(pre_checkout_query_dict, dict) assert isinstance(pre_checkout_query_dict, dict)
assert pre_checkout_query_dict['id'] == pre_checkout_query.id assert pre_checkout_query_dict['id'] == pre_checkout_query.id
assert pre_checkout_query_dict['invoice_payload'] == pre_checkout_query.invoice_payload assert pre_checkout_query_dict['invoice_payload'] == pre_checkout_query.invoice_payload
assert (pre_checkout_query_dict['shipping_option_id'] == assert (pre_checkout_query_dict['shipping_option_id']
pre_checkout_query.shipping_option_id) == pre_checkout_query.shipping_option_id)
assert pre_checkout_query_dict['currency'] == pre_checkout_query.currency assert pre_checkout_query_dict['currency'] == pre_checkout_query.currency
assert pre_checkout_query_dict['from'] == pre_checkout_query.from_user.to_dict() assert pre_checkout_query_dict['from'] == pre_checkout_query.from_user.to_dict()
assert pre_checkout_query_dict['order_info'] == pre_checkout_query.order_info.to_dict() assert pre_checkout_query_dict['order_info'] == pre_checkout_query.order_info.to_dict()

View file

@ -63,12 +63,12 @@ class TestReplyKeyboardMarkup(object):
reply_keyboard_markup_dict = reply_keyboard_markup.to_dict() reply_keyboard_markup_dict = reply_keyboard_markup.to_dict()
assert isinstance(reply_keyboard_markup_dict, dict) assert isinstance(reply_keyboard_markup_dict, dict)
assert (reply_keyboard_markup_dict['keyboard'][0][0] == assert (reply_keyboard_markup_dict['keyboard'][0][0]
reply_keyboard_markup.keyboard[0][0].to_dict()) == reply_keyboard_markup.keyboard[0][0].to_dict())
assert (reply_keyboard_markup_dict['keyboard'][0][1] == assert (reply_keyboard_markup_dict['keyboard'][0][1]
reply_keyboard_markup.keyboard[0][1].to_dict()) == reply_keyboard_markup.keyboard[0][1].to_dict())
assert (reply_keyboard_markup_dict['resize_keyboard'] == assert (reply_keyboard_markup_dict['resize_keyboard']
reply_keyboard_markup.resize_keyboard) == reply_keyboard_markup.resize_keyboard)
assert (reply_keyboard_markup_dict['one_time_keyboard'] == assert (reply_keyboard_markup_dict['one_time_keyboard']
reply_keyboard_markup.one_time_keyboard) == reply_keyboard_markup.one_time_keyboard)
assert reply_keyboard_markup_dict['selective'] == reply_keyboard_markup.selective assert reply_keyboard_markup_dict['selective'] == reply_keyboard_markup.selective

View file

@ -46,6 +46,6 @@ class TestReplyKeyboardRemove(object):
def test_to_dict(self, reply_keyboard_remove): def test_to_dict(self, reply_keyboard_remove):
reply_keyboard_remove_dict = reply_keyboard_remove.to_dict() reply_keyboard_remove_dict = reply_keyboard_remove.to_dict()
assert (reply_keyboard_remove_dict['remove_keyboard'] == assert (reply_keyboard_remove_dict['remove_keyboard']
reply_keyboard_remove.remove_keyboard) == reply_keyboard_remove.remove_keyboard)
assert reply_keyboard_remove_dict['selective'] == reply_keyboard_remove.selective assert reply_keyboard_remove_dict['selective'] == reply_keyboard_remove.selective

View file

@ -66,14 +66,14 @@ class TestSuccessfulPayment(object):
assert isinstance(successful_payment_dict, dict) assert isinstance(successful_payment_dict, dict)
assert successful_payment_dict['invoice_payload'] == successful_payment.invoice_payload assert successful_payment_dict['invoice_payload'] == successful_payment.invoice_payload
assert (successful_payment_dict['shipping_option_id'] == assert (successful_payment_dict['shipping_option_id']
successful_payment.shipping_option_id) == successful_payment.shipping_option_id)
assert successful_payment_dict['currency'] == successful_payment.currency assert successful_payment_dict['currency'] == successful_payment.currency
assert successful_payment_dict['order_info'] == successful_payment.order_info.to_dict() assert successful_payment_dict['order_info'] == successful_payment.order_info.to_dict()
assert (successful_payment_dict['telegram_payment_charge_id'] == assert (successful_payment_dict['telegram_payment_charge_id']
successful_payment.telegram_payment_charge_id) == successful_payment.telegram_payment_charge_id)
assert (successful_payment_dict['provider_payment_charge_id'] == assert (successful_payment_dict['provider_payment_charge_id']
successful_payment.provider_payment_charge_id) == successful_payment.provider_payment_charge_id)
def test_equality(self): def test_equality(self):
a = SuccessfulPayment(self.currency, self.total_amount, self.invoice_payload, a = SuccessfulPayment(self.currency, self.total_amount, self.invoice_payload,