zulip-bots: Set bot_handler type to BotHandler.

- Set `bot_handler` type to `BotHandler`.
- Fix mypy issues in improperly typed variables, params and returns.

Fixes part of #639
This commit is contained in:
LoopThrough-i-j 2021-03-04 01:24:28 +05:30 committed by Anders Kaseorg
parent a994c58439
commit 1fb3d529a9
41 changed files with 156 additions and 119 deletions

View file

@ -1,6 +1,7 @@
import mock
import os
from typing import Any, Dict
from zulip_bots.lib import BotHandler
import unittest
from .server_test_lib import BotServerTestCase
import json
@ -14,7 +15,7 @@ from zulip_botserver.input_parameters import parse_args
class BotServerTests(BotServerTestCase):
class MockMessageHandler:
def handle_message(self, message: Dict[str, str], bot_handler: Any) -> None:
def handle_message(self, message: Dict[str, str], bot_handler: BotHandler) -> None:
assert message == {'key': "test message"}
class MockLibModule: