mypy: Annotate helloworld bot.
This commit is contained in:
parent
69ad29faad
commit
8cd310493a
|
@ -1,8 +1,9 @@
|
|||
# See readme.md for instructions on running this code.
|
||||
|
||||
from typing import Any
|
||||
|
||||
class HelloWorldHandler(object):
|
||||
def usage(self):
|
||||
def usage(self) -> str:
|
||||
return '''
|
||||
This is a boilerplate bot that responds to a user query with
|
||||
"beep boop", which is robot for "Hello World".
|
||||
|
@ -11,8 +12,8 @@ class HelloWorldHandler(object):
|
|||
sophisticated, bots.
|
||||
'''
|
||||
|
||||
def handle_message(self, message, bot_handler):
|
||||
content = 'beep boop'
|
||||
def handle_message(self, message: Any, bot_handler: Any) -> None:
|
||||
content = 'beep boop' # type: str
|
||||
bot_handler.send_reply(message, content)
|
||||
|
||||
handler_class = HelloWorldHandler
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
from zulip_bots.test_lib import StubBotTestCase
|
||||
|
||||
class TestHelpBot(StubBotTestCase):
|
||||
bot_name = "helloworld"
|
||||
bot_name = "helloworld" # type: str
|
||||
|
||||
def test_bot(self):
|
||||
def test_bot(self) -> None:
|
||||
dialog = [
|
||||
('', 'beep boop'),
|
||||
('help', 'beep boop'),
|
||||
|
|
Loading…
Reference in a new issue