Since few bots directly call 'send_message' function of
'BotHandlerApi' class instead of calling 'send_reply' function
first, add 'mock_test_send_message' to check for 'send_message'
function.
All test_<bot>.py files now need to specify which function the bot
will be sending the response to, for each particular message.
Make 'test_virtual_fs.py' and 'test_thesaurus.py' test files
consistent with other bots.
Apparently, PyPI is very strict about package file names. Once you
upload files for 0.3.0, and only wish to make minor changes and
re-release it as the same version, it doesn't let you and complains
about identical file names.
Update example commands from calling by keyword 'fs'
(As was done previously) to calling by at-mention of
the bot.
Updates '/contrib_bots/bots/virtual_fs/virtual_fs.py' by
correcting instructions on how to call 'virtual_fs' bot.
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.
The previous test function in virtual_Bot made use of another function
called a 'sample_conversation' which had stateful example conversation
with virtual_fs bot.
The function sample_conversation is really useful, so made it accessible
to the users too.
Earlier, if virtual_fs bot is called without any argument, then the
bot returns nothing.
Now, virtual_fs bot replies with help message on how the user can
call this bot.
Remove previous unittest file for converter bot. Add new
test file which is in accordance with the test-suite famework
developed for contrib_bots.
Since 'coverter' folder is now a package (addition of __init__.py),
modify converter.py to import utils.py from the same package.
This commit adds mypy annotations for both the main
bots and the bots testing runner. It involves a change
to the BotHandlerApi send_message and update_message
funtions, which is compatible with every bot.
Tweaked by tabbott to use more expressive annotations.
`test-bots` would not run in Vagrant, displaying
the error "ValueError: no such test method in <class
'bots_test_lib.BotTestCase'>: runTest" This was due to
the `BotTestCase` class inheriting from the TestCase
class, even though it was not a unit test on its own.
This commit removes the inheritance of TestCase and
specifies `test_define` as the `runTest` method in
`TestDefineBot`.
This test uses unittest and mock library. It mocks
'BotHandlerApi' class. This test works independent of
the rest of the code outside contrib_bots folder.
Merged with a few changes by tabbott to fix lint issues; we'll need to
do further work on this framework, but since it's not hooked up to
anything, it's reasonable to merge early so others can collaborate on
improving it.