mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Fix python3 Exception message attribute not found.
This commit is contained in:
parent
f513270971
commit
0932e603fb
|
@ -155,7 +155,7 @@ class TeleBot:
|
||||||
if not none_stop:
|
if not none_stop:
|
||||||
self.__stop_polling.set()
|
self.__stop_polling.set()
|
||||||
logger.info("TeleBot: Exception occurred. Stopping.")
|
logger.info("TeleBot: Exception occurred. Stopping.")
|
||||||
logger.error(e.message)
|
logger.error(e)
|
||||||
|
|
||||||
logger.info('TeleBot: Stopped polling.')
|
logger.info('TeleBot: Stopped polling.')
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,16 @@ def test_send_file():
|
||||||
assert ret_msg.message_id
|
assert ret_msg.message_id
|
||||||
|
|
||||||
|
|
||||||
|
def test_send_file_exception():
|
||||||
|
tb = telebot.TeleBot(TOKEN)
|
||||||
|
try:
|
||||||
|
ret_msg = tb.send_document(CHAT_ID, None)
|
||||||
|
assert False
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
assert True
|
||||||
|
|
||||||
|
|
||||||
def test_send_photo_by_id():
|
def test_send_photo_by_id():
|
||||||
photo_id = 'AgADBQADTKgxG8YifgbcWQAB7Da9yYIx1rEyAAT-HYJ3CrJEqdA2AQABAg'
|
photo_id = 'AgADBQADTKgxG8YifgbcWQAB7Da9yYIx1rEyAAT-HYJ3CrJEqdA2AQABAg'
|
||||||
tb = telebot.TeleBot(TOKEN)
|
tb = telebot.TeleBot(TOKEN)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user