#13 Fix consumer's topics are not subscribed
Closed by qwan. Opened by qwan.
qwan/freshmaker fix-setting-topics  into  master

Download 13.patch

freshmaker consumer's topic is an instance attribute, if it is not
set prior to call parent's (which is FedmsgConsumer) init(),
the consumer will not subscribe to its topics while instantiating.

rebased

:+1: fix seems okay, although I wish the test was clearer on what exactly it's covering. The description just says "Tests subscribe topics of consumer" which could be basically anything. I like to write my test names in the style of "Test that X does Y" and then structure the test with clear setup--execute--assert phases.

If the bug is that the thing does not subscribe to the right topic... can we write a test to prove that it does subscribe to the right topic? Maybe it is testing that with the mocks (they are a little hard to comprehend) but could we do it with an actual broker, so we have more confidence that it will actually do the right thing when it's executed for real?

Anyway feel free to ignore my rant if you want.

Thanks for reviewing, the description is bad :(, I updated it in another PR #17, and will look on improve the test cases and add more test cases for testing the consumer (include the topics are subscribed indeed) in separate patch.

I'm closing this, since #17 includes the commit.

Pull-Request has been closed by qwan

Metadata