Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to bot.py #19

Open
ifosch opened this issue May 21, 2018 · 0 comments
Open

Add tests to bot.py #19

ifosch opened this issue May 21, 2018 · 0 comments
Assignees

Comments

@ifosch
Copy link
Member

ifosch commented May 21, 2018

Features to test:

  • Basic creation of the Bot object with the following cases:
    • No admins
    • Single admin
    • Many admins
    • No plugins
    • Single plugin
    • Multiple plugins
  • Bot.name and Bot.username, probably to be tested through logger mock
  • Bot.start_message: Varying on the amount of plugins, like the constructor
  • Bot.help_message, Bot.admin_help_message, and Bot.plugin_help_messages
  • Bot.enabled_plugins and Bot.disabled_plugins
  • Bot.start(bot, update)
  • Bot.help(bot, update): Varying on the amount of plugins and admins, like the constructor
  • Bot.settings(bot, update)
  • Bot.enable_plugin(bot, update, args) and Bot.disable_plugin(bot, update, args), for these cases:
    • Not being an admin, it tells user can't enable/disable plugins
    • Not receiving a plugin name, it tells user a plugin name must be specified
    • When the plugin is enabled/disabled, it tells the user the plugin is not disabled/enabled
    • When the plugin is disabled/enabled, it enables/disables the plugin and tells the user it has been enabled/disabled
  • Bot.run(): It starts polling

Fakes/spies to be implemented:

  • logger
  • Updater
  • CommandHandler
  • Dispatcher
  • BotPlugins
  • bot and update
@ifosch ifosch changed the title Add tests Add tests to bot.py May 24, 2018
@ifosch ifosch self-assigned this May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant