shaunagm / WelcomeBot

Other
35 stars 43 forks source link

Change hard-coded values in testing suite to variables #34

Closed shaunagm closed 9 years ago

shaunagm commented 10 years ago

Four tests (test_sent_messages, test_hello, test_help, & test_welcome_nick) currently fail and two tests (test_wait_time_from_non_admin and test_wait_time_from_admin) give errors because certain variables are hard-coded into the tests. We need to replace these with references to the variables themselves.

For example, in test_sent_messages (test_bot.py line 105) you can see that the list of strings Expected hard-codes the bot nickname of WelcomeBot2 and the channel openhatch-bots.

To fix this, we need to pass the variables used in bot.py (should be doable by passing botcode.channel, botcode.botnick, etc) and incorporate them into the test strings using the formatting described here and seen, for example, here.

At issue are, I think: channel, the bot's nick, and the number of admins allowed (the suite currently hard-codes for a single admin).

shaunagm commented 9 years ago

Should be all fixed here: https://github.com/shaunagm/WelcomeBot/commit/c7fb36898daa894bdafdb3d5ddfd1fde3eb62a94

I tried to catch all the hard-coded references, not just the ones that were causing errors, but I may have missed some.