Skip to content

Commit

Permalink
fix: fix of some pylint error
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzodidomenic committed Mar 19, 2024
1 parent f85e237 commit 4c5cb60
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
3 changes: 1 addition & 2 deletions src/bot_quake.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ async def file_reader(update, context) -> None:
massima_magnitudo = 10

if update.message.text is None:
await update.message.reply_text(MENU)
return
comandi = ""
else:
comandi = update.message.text
# Adesso il comando passato è diviso e ne posso gestire le eventuali funzionalità
Expand Down
18 changes: 0 additions & 18 deletions tests/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,24 +261,6 @@ async def test_file_reader_with_type_error(mocker: MockerFixture):
"Inserire un numero da 1 a 10 rilevati caratteri non numerici"
) # vediamo se la funzione mockata viene invocata e con quali parametri

@pytest.mark.asyncio
async def test_file_reader_with_none_message_error(mocker: MockerFixture):
"""Effettua il test della funzione test_file_reader"""
update = mocker.AsyncMock()
update.message.text = (
None # col mock possiamo presettare un valore che ci serve
)

update.message.reply_text = mocker.AsyncMock()

await bot_quake.file_reader(
update, None
) # invochiamo la funzione che al suo interno invoca update.message.reply_text

update.message.reply_text.assert_called_once_with(
MENU
) # vediamo se la funzione mockata viene invocata e con quali parametri


def test_build_bot(mocker: MockerFixture):
"""Effettua il test della funzione build_bot"""
Expand Down

0 comments on commit 4c5cb60

Please sign in to comment.