Code review comment for lp:~rockstar/launchpad/upgrade-job-2.0-changes

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Hi Paul,

This is a nice improvement. Please change the zcml to require launchpad.Edit for requestUpgrade(). I just have one comment below.

merge-conditional

-Edwin

> === modified file 'lib/lp/code/model/tests/test_branch.py'
> --- lib/lp/code/model/tests/test_branch.py 2010-01-07 06:37:14 +0000
> +++ lib/lp/code/model/tests/test_branch.py 2010-01-19 22:00:02 +0000
> @@ -315,24 +315,33 @@
> SourcePackage(branch.sourcepackagename, branch.distroseries),
> branch.sourcepackage)
>
> + def test_needsUpgrading_already_requested(self):
> + # A branch has a needs_upgrading attribute that returns whether or
> not
> + # a branch needs to be upgraded or not. If the format is
> + # unrecognized, we don't try to upgrade it.
> + branch = self.factory.makePersonalBranch(
> + branch_format=BranchFormat.BZR_BRANCH_6,
> + repository_format=RepositoryFormat.BZR_CHK_2A)
> + branch.requestUpgrade()
> +
> + self.assertFalse(branch.needs_upgrading)
> +
> def test_needsUpgrading_branch_format_unrecognized(self):
> # A branch has a needs_upgrading attribute that returns whether or
> not
> # a branch needs to be upgraded or not. If the format is
> # unrecognized, we don't try to upgrade it.
> branch = self.factory.makePersonalBranch(
> - branch_format=BranchFormat.UNRECOGNIZED)
> + branch_format=BranchFormat.UNRECOGNIZED,
> + repository_format=RepositoryFormat.BZR_CHK_2A)
> self.assertFalse(branch.needs_upgrading)
>
> def test_needsUpgrading_branch_format_upgrade_not_needed(self):
> # A branch has a needs_upgrading attribute that returns whether or
> not
> # a branch needs to be upgraded or not. If a branch is up to date,
> it

s/up to date/up-to-date/

review: Approve (code)

« Back to merge proposal