Skip to content

Commit

Permalink
Fix test trying to login to chat.com
Browse files Browse the repository at this point in the history
(cherry picked from commit 489db4ca5d3cc3322e79f381865f2d730cf27df6)
  • Loading branch information
unode committed Aug 22, 2022
1 parent 62943af commit 4c572f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/unit_tests/bot_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

@pytest.fixture(scope="function")
def bot():
bot = Bot(plugins=[ExamplePlugin()], settings=Settings(DEBUG=True))
yield bot
bot.stop() # if the bot was started, stop it
# Patch login to avoid sending requests to the internet
with mock.patch("mmpy_bot.driver.Driver.login") as login:
bot = Bot(plugins=[ExamplePlugin()], settings=Settings(DEBUG=True))
login.assert_called_once()
yield bot
bot.stop() # if the bot was started, stop it


class TestBot:
Expand Down

0 comments on commit 4c572f1

Please sign in to comment.