Commit graph

10 commits

Author SHA1 Message Date
neiljp 1991e0128b contrib_bots: Add check_expected_responses() test helper and use it.
This further simplifies the logic for testing a contrib_bots bot to
require very little code per test in the common case.
2017-05-29 20:39:27 -07:00
Abhijeet Kaur 8cbda46a61 testsuite: Add tests for wikipedia bot in contrib_bots.
Add test file 'Test_wikipedia.py'.

Since wikipedia links for the same query may different according
to relevance. This test will also be written by mocking HTTP
traffic. But this can work for now.
2017-05-28 17:12:11 -07:00
Elliott Jin dd71daa09f bots: Add __init__.py so bot modules can be imported. 2017-05-25 15:00:51 -07:00
Krzysztof Krzysztof 12e81fd024 bots: Add empty message support in Wikipedia bot. 2017-05-24 14:49:57 -07:00
neiljp bd37161ece Factor out send_reply functionality into bot_lib 2017-05-23 12:40:08 -07:00
neiljp ad25f27853 Update Wikipedia bot to reply to multiple user private chats. 2017-05-23 08:17:35 -07:00
Abhijeet Kaur 92d2981726 contrib bots: Edit code for uniformity.
Add one function (get_bot_botname_response()) that generates response
from the given input and replies back to the handle_message with the final
content of response to be sent. Also add code to bots(except followup) to
reply to private messages along with stream messages.
2017-03-14 13:29:19 -07:00
Abhijeet Kaur 9a8dc7c622 Remove triage_message() function from all the contrib-bots.
To make all bots consistent add shared function in bot_lib.py
to check if this bot is called. All bots respond to at-mention of
the bot instead of their specific names.
2017-02-17 06:51:48 -08:00
Abhijeet Kaur 2282000d78 bug fix: Fix wikipedia bot in case no results are found.
Incorrect Index access in wikipedia.py resulted in IndexError and
wikipedia bot to crash for few queries. This causes the bug to be fixed.
Replaced url to avoid 2 redirects and enhance performance.
Fixes: #3508.
2017-02-09 12:20:51 -08:00
Robert Hönig fefe869748 Restructure contrib_bots bots to new layout.
In order to make the layout of all bots consistent, this commit
moves each bot into a folder with its name and modifies 'run.py'
so that only bots with such a structure can be executed. 'lib'
gets renamed to 'bots'.
2017-01-22 05:42:46 -08:00