Skip to content

Commit f11e960

Browse files
committed
Add more uses of @OverRide.
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent f78e6e6 commit f11e960

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

zulip_bots/zulip_bots/bots/beeminder/test_beeminder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from unittest.mock import patch
33

44
from requests.exceptions import ConnectionError
5+
from typing_extensions import override
56

67
from zulip_bots.test_file_utils import get_bot_message_handler
78
from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler
@@ -21,6 +22,7 @@ class TestBeeminderBot(BotTestCase, DefaultTests):
2122
\n* `comment`**:** Add a comment [**NOTE:** Optional field, default is *None*]\
2223
"""
2324

25+
@override
2426
def test_bot_responds_to_empty_message(self) -> None:
2527
with self.mock_config_info(self.normal_config), self.mock_http_conversation(
2628
"test_valid_auth_token"

zulip_bots/zulip_bots/bots/flock/test_flock.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from unittest.mock import patch
33

44
from requests.exceptions import ConnectionError
5+
from typing_extensions import override
56

67
from zulip_bots.test_lib import BotTestCase, DefaultTests
78

@@ -17,6 +18,7 @@ class TestFlockBot(BotTestCase, DefaultTests):
1718
*Syntax*: **@botname to: message** where `to` is **firstName** of recipient.
1819
"""
1920

21+
@override
2022
def test_bot_responds_to_empty_message(self) -> None:
2123
self.verify_reply("", self.help_message)
2224

zulip_bots/zulip_bots/bots/game_of_fifteen/test_game_of_fifteen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Dict, Final, List, Tuple
22

3+
from typing_extensions import override
4+
35
from zulip_bots.bots.game_of_fifteen.game_of_fifteen import GameOfFifteenModel
46
from zulip_bots.game_handler import BadMoveError
57
from zulip_bots.test_lib import BotTestCase, DefaultTests
@@ -8,6 +10,7 @@
810
class TestGameOfFifteenBot(BotTestCase, DefaultTests):
911
bot_name = "game_of_fifteen"
1012

13+
@override
1114
def make_request_message(
1215
self, content: str, user: str = "[email protected]", user_name: str = "foo"
1316
) -> Dict[str, str]:

zulip_bots/zulip_bots/bots/jira/test_jira.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Final
22

3+
from typing_extensions import override
4+
35
from zulip_bots.test_lib import BotTestCase, DefaultTests
46

57

@@ -260,7 +262,7 @@ def test_help(self) -> None:
260262
with self.mock_config_info(self.MOCK_CONFIG_INFO):
261263
self.verify_reply("help", self.MOCK_HELP_RESPONSE)
262264

263-
# This overrides the default one in `BotTestCase`.
265+
@override
264266
def test_bot_responds_to_empty_message(self) -> None:
265267
with self.mock_config_info(self.MOCK_CONFIG_INFO):
266268
self.verify_reply("", self.MOCK_NOTHING_RESPONSE)

zulip_bots/zulip_bots/bots/merels/merels.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Any, Final, List
22

3+
from typing_extensions import override
4+
35
from zulip_bots.game_handler import GameAdapter, SamePlayerMoveError
46

57
from .libraries import database, game, game_data, mechanics
@@ -76,6 +78,7 @@ class MerelsHandler(GameAdapter):
7678
"description": "Lets you play merels against any player.",
7779
}
7880

81+
@override
7982
def usage(self) -> str:
8083
return game.get_info()
8184

zulip_bots/zulip_bots/bots/twitpost/test_twitpost.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from typing import Final
22
from unittest.mock import patch
33

4+
from typing_extensions import override
5+
46
from zulip_bots.test_file_utils import get_bot_message_handler, read_bot_fixture_data
57
from zulip_bots.test_lib import BotTestCase, DefaultTests, StubBotHandler
68

@@ -15,6 +17,7 @@ class TestTwitpostBot(BotTestCase, DefaultTests):
1517
}
1618
api_response = read_bot_fixture_data("twitpost", "api_response")
1719

20+
@override
1821
def test_bot_usage(self) -> None:
1922
bot = get_bot_message_handler(self.bot_name)
2023
bot_handler = StubBotHandler()
@@ -24,6 +27,7 @@ def test_bot_usage(self) -> None:
2427

2528
self.assertIn("This bot posts on twitter from zulip chat itself", bot.usage())
2629

30+
@override
2731
def test_bot_responds_to_empty_message(self) -> None:
2832
with self.mock_config_info(self.mock_config):
2933
self.verify_reply("", "Please check help for usage.")

0 commit comments

Comments
 (0)