From 031510410bea9a210c6eee0d296977ef2d7b910e Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sat, 9 Jun 2018 17:36:18 -0700 Subject: [PATCH] xkcd tests: Use consistent imports. --- zulip_bots/zulip_bots/bots/xkcd/test_xkcd.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/zulip_bots/zulip_bots/bots/xkcd/test_xkcd.py b/zulip_bots/zulip_bots/bots/xkcd/test_xkcd.py index cde20f0..5ef5eb3 100755 --- a/zulip_bots/zulip_bots/bots/xkcd/test_xkcd.py +++ b/zulip_bots/zulip_bots/bots/xkcd/test_xkcd.py @@ -1,4 +1,3 @@ -from unittest import mock from unittest.mock import MagicMock, patch from zulip_bots.test_lib import BotTestCase, DefaultTests @@ -20,7 +19,7 @@ class TestXkcdBot(BotTestCase, DefaultTests): with self.mock_http_conversation('test_random'): # Mock randint function. with patch('zulip_bots.bots.xkcd.xkcd.random.randint') as randint: - mock_rand_value = mock.MagicMock() + mock_rand_value = MagicMock() mock_rand_value.return_value = 1800 randint.return_value = mock_rand_value.return_value self.verify_reply('random', bot_response) @@ -31,8 +30,8 @@ class TestXkcdBot(BotTestCase, DefaultTests): with self.mock_http_conversation('test_specific_id'): self.verify_reply('1', bot_response) - @mock.patch('logging.exception') - def test_invalid_comic_ids(self, mock_logging_exception: mock.Mock) -> None: + @patch('logging.exception') + def test_invalid_comic_ids(self, mock_logging_exception: MagicMock) -> None: invalid_id_txt = "Sorry, there is likely no xkcd comic strip with id: #" for comic_id, fixture in (('0', 'test_not_existing_id_2'),