nmlorg / metabot

Modularized, multi-account bot.
https://metabot.readthedocs.io/
5 stars 0 forks source link

Add test coverage for metabot.modules.events.modinit._hourly #69

Closed nmlorg closed 5 years ago

nmlorg commented 5 years ago

I've broken _hourly a couple times now (including f7e1e24) simply because it lacked even a smoke test, and work on #64 is a little hampered because of this.

I'm thinking there would literally just be a test_events.test_modinit that either monkeypatches time.time or possibly provides a mocked multibot (or just multibot.loop.queue) that just allows the test to advance the time arbitrarily. Though it might be more straightforward in the long term to actually pull most of _hourly into a fully independent function, so the remaining _hourly stub just calls multibot.multical.poll() and _new_independent_hourly(multibot).