Promote mock_http_conversations to its superclass.
This commit is contained in:
parent
3f79136dd7
commit
db08586df6
|
@ -107,6 +107,12 @@ class StubBotTestCase(TestCase):
|
||||||
bot = get_bot_message_handler(self.bot_name)
|
bot = get_bot_message_handler(self.bot_name)
|
||||||
self.assertNotEqual(bot.usage(), '')
|
self.assertNotEqual(bot.usage(), '')
|
||||||
|
|
||||||
|
def mock_http_conversation(self, test_name):
|
||||||
|
# type: (str) -> Any
|
||||||
|
assert test_name is not None
|
||||||
|
http_data = read_bot_fixture_data(self.bot_name, test_name)
|
||||||
|
return mock_http_conversation(http_data)
|
||||||
|
|
||||||
def get_bot_message_handler(bot_name):
|
def get_bot_message_handler(bot_name):
|
||||||
# type: (str) -> Any
|
# type: (str) -> Any
|
||||||
# message_handler is of type 'Any', since it can contain any bot's
|
# message_handler is of type 'Any', since it can contain any bot's
|
||||||
|
@ -258,12 +264,6 @@ class BotTestCase(StubBotTestCase):
|
||||||
yield
|
yield
|
||||||
self.mock_bot_handler.get_config_info.return_value = None
|
self.mock_bot_handler.get_config_info.return_value = None
|
||||||
|
|
||||||
def mock_http_conversation(self, test_name):
|
|
||||||
# type: (str) -> Any
|
|
||||||
assert test_name is not None
|
|
||||||
http_data = read_bot_fixture_data(self.bot_name, test_name)
|
|
||||||
return mock_http_conversation(http_data)
|
|
||||||
|
|
||||||
def assert_bot_response(self, message, response, expected_method):
|
def assert_bot_response(self, message, response, expected_method):
|
||||||
# type: (Dict[str, Any], Dict[str, Any], str) -> None
|
# type: (Dict[str, Any], Dict[str, Any], str) -> None
|
||||||
# Strictly speaking, this function is not needed anymore,
|
# Strictly speaking, this function is not needed anymore,
|
||||||
|
|
Loading…
Reference in a new issue