Merge lp:~deryck/launchpad/better-testing-for-status-changes into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Deryck Hodge on 2010-10-18 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 11754 | ||||
| Proposed branch: | lp:~deryck/launchpad/better-testing-for-status-changes | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
534 lines (+366/-146) 2 files modified
lib/lp/bugs/doc/bugtask-status-changes.txt (+51/-131) lib/lp/bugs/tests/test_bugtask_status.py (+315/-15) |
||||
| To merge this branch: | bzr merge lp:~deryck/launchpad/better-testing-for-status-changes | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Abel Deuring (community) | code | 2010-10-15 | Approve on 2010-10-18 |
|
Review via email:
|
|||
Commit Message
Refactor doctest for bugtask status changes into separate unit test and documentation.
Description of the Change
This branch is the first toward a fix for Bug #126516, or more specifically for a fix to limit transitioning away from Fix Released status. Before this branch the tests for bugtask status changes was a mix of a unit test and doctest, both living under lp.bugs.tests.
The branch refactors that mess, opting to do a complete unit test of BugTask.
To test, run:
./bin/test -cvvt bugtask-
./bin/test -cvvt test_bugtask_status
Thanks for the review!
| Abel Deuring (adeuring) wrote : | # |
| Abel Deuring (adeuring) wrote : | # |
Hi Deryck,
thanks for the refactoring. r=me.
Just a few nitpicks:
could you add TestCases for the celebrities bug_watch_updater,
bug_importer, janitor?
> +class TestBugTaskStat
> + """Base class used to test privileged users and status transitions."""
> +
> + layer = LaunchpadFuncti
> +
> + def setUp(self):
> + super(TestBugTa
> + # Creation of task and target are deferred to subclasses.
> + self.task = None
> + self.person = None
> + self.makePerson
> +
> + def makePersonAndTa
> + """Create a bug task and privileged person for this task.
> +
> + This method is user by subclasses to correctly setup
> + each test.
> + """
I think this should be something like "is (overloaded|
subclasses"
cheers
Abel

(17:52:07) adeuring: deryck: I think it might make sense to change the test setup so that the product owner is not a member of the bug supervisor team; right now, the term "or user.inTeam( pillar. owner)" in canTransitionTo Status( ) is not executed bug_watch_ updater, celebrities. bug_importer, celebrities. janitor. You could add these tests quickly by definig a base class for tests of "extended permissions", where you do not define the user who is tested, then derive the "real" test classes for supervisor, owner and the celebrities.
(17:52:53) deryck: adeuring, ok, that's a good idea. I can do that.
(17:53:07) adeuring: deryck: thanks! another suggestion, before you start ;)
(17:53:16) deryck: sure
(17:55:28) salgado heißt jetzt salgado-lunch
(17:55:30) adeuring: deryck: you don't test at all for celebrities.
(17:55:45) adeuring: That should make the tests a bit shorter and more comprehensive
(17:57:44) deryck: sure, I like that idea. I can do that, too.
(17:57:59) adeuring: deryck: cool, thanks!