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.
This refactor makes the nested class 'StateHandler' in the
file /contrib_bots/bot_lib.py independent class. It previously
was nested in 'run_message_handler_for_bot' function.
This is done to write a cleaner test file for contrib_bots using
mock library.
The converter bot depended on past.utils.old_div,
which is not supported anymore. Updating the code
to use the // operator, which provides the same
functionality.
run.py requires that the location of the provided bot matches the location
of run.py. However, run.py previously failed in the case where the location
included a symlink.
Now this bot follows our latest structure for contrib_bots.
Switched the dependencies instructions, to install "google" rather than
"google-api-python-client".
Added all the search terms to the query (not only the first one).