Skip to content

Commit 14b1ff9

Browse files
committed
Fix initialization test called_once_with -> assert_called_once_with
This test was silently failing as it was using an outdated mock method
1 parent 798737a commit 14b1ff9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/unit_tests/bot_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ def test_init(self, login):
2727
for plugin in plugins:
2828
plugin.initialize = mock.MagicMock()
2929

30+
settings = Settings(MATTERMOST_URL="test_url.org", BOT_TOKEN="random_token")
3031
# Create a bot and verify that it gets initialized correctly
3132
bot = Bot(
32-
settings=Settings(MATTERMOST_URL="test_url.org", BOT_TOKEN="random_token"),
33+
settings=settings,
3334
plugins=plugins,
3435
)
3536
assert bot.driver.options["url"] == "test_url.org"
@@ -40,7 +41,7 @@ def test_init(self, login):
4041

4142
# Verify that all of the passed plugins were initialized
4243
for plugin in plugins:
43-
assert plugin.initialize.called_once_with(bot.driver)
44+
assert plugin.initialize.assert_called_once_with(bot.driver, bot.plugin_manager, settings)
4445

4546
@mock.patch.multiple("mmpy_bot.Plugin", on_start=mock.DEFAULT, on_stop=mock.DEFAULT)
4647
def test_run(self, bot, **mocks):

0 commit comments

Comments
 (0)