This is the best way to do this check, since it isn't subject to i18n
modifying the strings. The server feature was originally introduced
in zulip/zulip commit 709c3b50fcba333740bb337bac69a801dbbdc4ee.
Since it's only 1 year old and the outcome is quite bad if this check
weren't present, we preserve support for older servers.
This example makes use of get_alert_words, add_alert_words and
remove_alert_words, three methods that interact with the
/users/me/alert_words REST API endpoint.
This commit changes the default behavior for a hypothetical bot
named 'bot_one' to the following with the config file:
1. Find and load section named 'bot_one', else...
2. Find and load the first section, else...
3. Exit with error message.
Also, we now gracefully show missing options in a config section
instead of printing the whole stacktrace of the exception.
The merels bot was ported to game_handler, but the tests
were not updated. Most changes are minimal, but require
changing how to start a game. It is unclear if the
merels start game was properly updated.
Author: Jordan Troutman <jttroutman99@gmail.com>
The previous style was causing duplicate tests for the dropbox_share bot
for the unittest runner, due to globbing of test_*.py giving duplicates.
However, it also avoids unintentional duplication of bot names to test
on the command line being tested multiple times, though again only with
the unittest runner.
Encountered several issues with test cases initially,
where test cases were failing due to the structure of the tests
within the file. This was circumvented by creating a separate
instance of the class TicTacToeModel for each test case
in order to focus on unit testing. There might be an issue with
the _get_game_handlers() function at the end of the file
which is used to obtain the model and message information,
it seems to be getting the entire class TicTacToeModel instead of
creating an instance of the class. Overall, this commit focuses
on creating a precedent for writing test cases involving TicTacToeModel,
and implements basic cases which can be extended to larger
edge cases in the future. Testing was done locally by running
./tools/test-bots until we were able to get the response 'ok' for
all the test cases written. We also used coverage in order to test the
coverage of the cases. While we were not able to increase
the coverage as much as we would have liked, we were able to
identify several issues and fix them, hopefully making it easier
for future contributors to add additional test cases to TicTacToeModel.
Overall, we would like special attention given to the way
that TicTacToeModel() was initailized in these tests and whether or not
this is a scalable precedent for future tests.
Fixes: #122