I have a python project written using rabbitmq, and I'm wondering how I should write unit tests for it/what are best practices.
Since the code requires a rabbitmq server to be running in the background these are the three options I've come up with:
- write some checker that checks at the start of a test suite whether rabbit is running and fails if it doesn't - not ideal because it requires the manual starting of rabbitmq
- automatically start a process with rabbitmq on each test setUp and kill it on tearDown - for some reason this creates connection errors
- mock out rabbitmq - does anyone have any suggestions or tips on this one?
Thanks!
Jon