python-zulip-api/zulip_bots
Kishan Patel ea370031ee tictactoe: Add tests for TicTacToeModel functions.
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
2018-06-28 14:43:29 -04:00
..
zulip_bots tictactoe: Add tests for TicTacToeModel functions. 2018-06-28 14:43:29 -04:00
architecture.md zulip_bots: Update README.md. 2017-11-14 09:51:09 -08:00
README.md zulip_bots: Consolidate game-playing bots. 2018-01-22 11:30:31 -05:00
setup.py pypi: Release 0.5.0. 2018-06-07 12:05:18 -02:30

Zulip bots

This directory contains the source code for the zulip_bots PyPI package.

The Zulip documentation has guides on using Zulip's bot system and writing your own bots.

Directory structure

zulip_bots  # This directory
├───zulip_bots  # `zulip_bots` package.
│   ├───bots/  # Actively maintained and tested bots.
│   ├───bots_unmaintained/  # Unmaintained, potentially broken bots.
│   ├───game_handler.py  # Handles game-related bots.
│   ├───lib.py  # Backbone of run.py
│   ├───provision.py  # Creates a development environment.
│   ├───run.py  # Used to run bots.
│   ├───simple_lib.py  # Used for terminal testing.
│   ├───test_lib.py  # Backbone for bot unit tests.
│   ├───test_run.py  # Unit tests for run.py
│   └───terminal.py  # Used to test bots in the command line.
└───setup.py  # Script for packaging.