mypy: Add annotations for help.
This commit is contained in:
parent
40c09b4b16
commit
9d5fbc2b5b
3 changed files with 8 additions and 3 deletions
|
@ -1,7 +1,8 @@
|
|||
# See readme.md for instructions on running this code.
|
||||
from typing import Any, Dict
|
||||
|
||||
class HelpHandler(object):
|
||||
def usage(self):
|
||||
def usage(self: Any) -> str:
|
||||
return '''
|
||||
This plugin will give info about Zulip to
|
||||
any user that types a message saying "help".
|
||||
|
@ -11,7 +12,7 @@ class HelpHandler(object):
|
|||
your Zulip instance.
|
||||
'''
|
||||
|
||||
def handle_message(self, message, bot_handler):
|
||||
def handle_message(self: Any, message: Dict[str, str], bot_handler: Any) -> None:
|
||||
help_content = "Info on Zulip can be found here:\nhttps://github.com/zulip/zulip"
|
||||
bot_handler.send_reply(message, help_content)
|
||||
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
from zulip_bots.test_lib import StubBotTestCase
|
||||
|
||||
from typing import Any
|
||||
|
||||
class TestHelpBot(StubBotTestCase):
|
||||
bot_name = "help"
|
||||
|
||||
def test_bot(self):
|
||||
def test_bot(self: Any) -> None:
|
||||
help_text = "Info on Zulip can be found here:\nhttps://github.com/zulip/zulip"
|
||||
requests = ["", "help", "Hi, my name is abc"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue