Hey all.
I've opened a small utility library I wrote for testing modules with python.
You can install it by simply running pip install rmtest
It allows to quickly write tests and run them against your module, using ephemeral disposable redis instances, so you're not depending on redis to be running for the tests to succeed.
here's a simle example:
from rmtest import ModuleTestCase
class MyTestCase(ModuleTestCase('/path/to/module.so')):
def testCmd(self):
with self.redis() as r:
self.assertOk(r.execute_command('mymodule.dosomething', 'foo', 'bar'))You can also control the path to your module and the redis server executable with env variables.
It extends the default python unittesting framework, so you get all the assertions you are used to, plus a few modules-specific convenience functions.
I hope you'll find it useful. An real-world usage can be found here: