Merge branch 'develop' into dependabot/pip/develop/sqlalchemy-2.0.26
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
markdown==3.5.2
|
markdown==3.5.2
|
||||||
mkdocs==1.5.3
|
mkdocs==1.5.3
|
||||||
mkdocs-material==9.5.8
|
mkdocs-material==9.5.9
|
||||||
mdx_truly_sane_lists==1.3
|
mdx_truly_sane_lists==1.3
|
||||||
pymdown-extensions==10.7
|
pymdown-extensions==10.7
|
||||||
jinja2==3.1.3
|
jinja2==3.1.3
|
||||||
|
|||||||
@@ -1777,13 +1777,9 @@ class Telegram(RPCHandler):
|
|||||||
msg += f"\nUpdated: {datetime.now().ctime()}"
|
msg += f"\nUpdated: {datetime.now().ctime()}"
|
||||||
if not query.message:
|
if not query.message:
|
||||||
return
|
return
|
||||||
chat_id = query.message.chat_id
|
|
||||||
message_id = query.message.message_id
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self._app.bot.edit_message_text(
|
await query.edit_message_text(
|
||||||
chat_id=chat_id,
|
|
||||||
message_id=message_id,
|
|
||||||
text=msg,
|
text=msg,
|
||||||
parse_mode=parse_mode,
|
parse_mode=parse_mode,
|
||||||
reply_markup=reply_markup
|
reply_markup=reply_markup
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ coveralls==3.3.1
|
|||||||
ruff==0.2.1
|
ruff==0.2.1
|
||||||
mypy==1.8.0
|
mypy==1.8.0
|
||||||
pre-commit==3.6.1
|
pre-commit==3.6.1
|
||||||
pytest==7.4.4
|
pytest==8.0.0
|
||||||
pytest-asyncio==0.23.4
|
pytest-asyncio==0.23.5
|
||||||
pytest-cov==4.1.0
|
pytest-cov==4.1.0
|
||||||
pytest-mock==3.12.0
|
pytest-mock==3.12.0
|
||||||
pytest-random-order==1.1.1
|
pytest-random-order==1.1.1
|
||||||
|
|||||||
@@ -8,5 +8,5 @@ joblib==1.3.2
|
|||||||
catboost==1.2.2; 'arm' not in platform_machine and python_version < '3.12'
|
catboost==1.2.2; 'arm' not in platform_machine and python_version < '3.12'
|
||||||
lightgbm==4.3.0
|
lightgbm==4.3.0
|
||||||
xgboost==2.0.3
|
xgboost==2.0.3
|
||||||
tensorboard==2.15.1
|
tensorboard==2.15.2
|
||||||
datasieve==0.1.7
|
datasieve==0.1.7
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ ccxt==4.2.42
|
|||||||
cryptography==42.0.2
|
cryptography==42.0.2
|
||||||
aiohttp==3.9.3
|
aiohttp==3.9.3
|
||||||
SQLAlchemy==2.0.26
|
SQLAlchemy==2.0.26
|
||||||
python-telegram-bot==20.7
|
python-telegram-bot==20.8
|
||||||
# can't be hard-pinned due to telegram-bot pinning httpx with ~
|
# can't be hard-pinned due to telegram-bot pinning httpx with ~
|
||||||
httpx>=0.24.1
|
httpx>=0.24.1
|
||||||
arrow==1.3.0
|
arrow==1.3.0
|
||||||
|
|||||||
@@ -2557,22 +2557,22 @@ async def test_telegram__send_msg(default_conf, mocker, caplog) -> None:
|
|||||||
|
|
||||||
# Test update
|
# Test update
|
||||||
query = MagicMock()
|
query = MagicMock()
|
||||||
|
query.edit_message_text = AsyncMock()
|
||||||
await telegram._send_msg('test', callback_path="DeadBeef", query=query, reload_able=True)
|
await telegram._send_msg('test', callback_path="DeadBeef", query=query, reload_able=True)
|
||||||
edit_message_text = telegram._app.bot.edit_message_text
|
assert query.edit_message_text.call_count == 1
|
||||||
assert edit_message_text.call_count == 1
|
assert "Updated: " in query.edit_message_text.call_args_list[0][1]['text']
|
||||||
assert "Updated: " in edit_message_text.call_args_list[0][1]['text']
|
|
||||||
|
|
||||||
telegram._app.bot.edit_message_text = AsyncMock(side_effect=BadRequest("not modified"))
|
query.edit_message_text = AsyncMock(side_effect=BadRequest("not modified"))
|
||||||
await telegram._send_msg('test', callback_path="DeadBeef", query=query)
|
await telegram._send_msg('test', callback_path="DeadBeef", query=query)
|
||||||
assert telegram._app.bot.edit_message_text.call_count == 1
|
assert query.edit_message_text.call_count == 1
|
||||||
assert not log_has_re(r"TelegramError: .*", caplog)
|
assert not log_has_re(r"TelegramError: .*", caplog)
|
||||||
|
|
||||||
telegram._app.bot.edit_message_text = AsyncMock(side_effect=BadRequest(""))
|
query.edit_message_text = AsyncMock(side_effect=BadRequest(""))
|
||||||
await telegram._send_msg('test2', callback_path="DeadBeef", query=query)
|
await telegram._send_msg('test2', callback_path="DeadBeef", query=query)
|
||||||
assert telegram._app.bot.edit_message_text.call_count == 1
|
assert query.edit_message_text.call_count == 1
|
||||||
assert log_has_re(r"TelegramError: .*", caplog)
|
assert log_has_re(r"TelegramError: .*", caplog)
|
||||||
|
|
||||||
telegram._app.bot.edit_message_text = AsyncMock(side_effect=TelegramError("DeadBEEF"))
|
query.edit_message_text = AsyncMock(side_effect=TelegramError("DeadBEEF"))
|
||||||
await telegram._send_msg('test3', callback_path="DeadBeef", query=query)
|
await telegram._send_msg('test3', callback_path="DeadBeef", query=query)
|
||||||
|
|
||||||
assert log_has_re(r"TelegramError: DeadBEEF! Giving up.*", caplog)
|
assert log_has_re(r"TelegramError: DeadBEEF! Giving up.*", caplog)
|
||||||
|
|||||||
Reference in New Issue
Block a user