Code review comment for lp:~adeuring/launchpad/bug-594247-unittests-for-searchtasks-3

Revision history for this message
Gavin Panella (allenap) wrote :

Hi Abel, I decided to start from scratch!

[1]

+from lp.registry.interfaces.sourcepackage import ISourcePackage
+from lp.registry.interfaces.distributionsourcepackage import (

These are out of order. Consider using utilities/format-import (or
it's more convenient brother format-new-and-modified-imports).

[2]

+ search_result = self.runSearch(params)
+ expected = self.resultValuesForBugtasks(self.bugtasks[2:3])
+ self.assertEqual(expected, search_result)

It's not worth changing it here, but a custom assertion method might
have saved a few keystrokes:

    def assertSearchFinds(self, params, bugtasks):
        search_result = self.runSearch(params)
        expected = self.resultValuesForBugtasks(bugtasks)
        self.assertEqual(expected, search_result)

[3]

+ raise AssertionError(
+ 'No bug task found for a product that is not the target of '
+ 'the main test bugtask.')

Either raise self.failureException or call self.fail(message).

review: Approve

« Back to merge proposal