Merge lp:~jelmer/launchpad/archive-arch-fix into lp:launchpad
Proposed by
Jelmer Vernooij
Status: | Merged |
---|---|
Approved by: | Māris Fogels |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11093 |
Proposed branch: | lp:~jelmer/launchpad/archive-arch-fix |
Merge into: | lp:launchpad |
Diff against target: |
91 lines (+31/-4) 2 files modified
lib/lp/soyuz/model/archivearch.py (+3/-2) lib/lp/soyuz/tests/test_archivearch.py (+28/-2) |
To merge this branch: | bzr merge lp:~jelmer/launchpad/archive-arch-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Māris Fogels (community) | release-critical | Approve | |
Henning Eggers (community) | code | Approve | |
Review via email: mp+29160@code.launchpad.net |
Description of the change
ArchiveArchSet.
This also includes a test for ArchiveArchSet.
To post a comment you must log in.
Hi Jelmer,
thank you for this quick fix. I have a few comments about the tests and will
wait for your reply before I approve the branch.
Cheers,
Henning
Am 04.07.2010 01:40, schrieb Jelmer Vernooij: soyuz/model/ archivearch. py' soyuz/model/ archivearch. py 2010-02-25 15:25:30 +0000 soyuz/model/ archivearch. py 2010-07-03 23:40:54 +0000 launchpad. webapp. interfaces import ( processorfamily == ProcessorFamily .id)) .archive == archive.id, processorfamily == ProcessorFamily .id))) *origin) .find( y.restricted == True)) soyuz/tests/ test_archivearc h.py' soyuz/tests/ test_archivearc h.py 2010-02-25 15:25:30 +0000 soyuz/tests/ test_archivearc h.py 2010-07-03 23:40:54 +0000 interfaces. distribution import IDistributionSet
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -13,7 +13,7 @@
> from canonical.
> IStoreSelector, MAIN_STORE, DEFAULT_FLAVOR)
>
> -from storm.expr import Join, LeftJoin
> +from storm.expr import And, Join, LeftJoin
> from storm.locals import Int, Reference, Storm
>
>
> @@ -65,7 +65,8 @@
> ProcessorFamily,
> LeftJoin(
> ArchiveArch,
> - ArchiveArch.
> + And(ArchiveArch
> + ArchiveArch.
> result_set = store.using(
> (ProcessorFamily, ArchiveArch),
> (ProcessorFamil
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -11,6 +11,7 @@
>
> from lp.testing import TestCaseWithFactory
>
> +from lp.registry.
from canonical. launchpad. interfaces import ILaunchpadCeleb rities
See below.
> from lp.registry. interfaces. person import IPersonSet interfaces. archivearch import IArchiveArchSet interfaces. processor import IProcessorFamilySet veArch, self).setUp() IPersonSet) .getByName( 'cprov' ).archive IDistributionSe t)['ubuntu' ]
> from lp.soyuz.
> from lp.soyuz.
> @@ -24,6 +25,8 @@
> super(TestArchi
>
> self.ppa = getUtility(
> + ubuntu = getUtility(
> + self.ubuntu_archive = ubuntu.main_archive
We have a celebrity that you should use for this.
getUtility( ILaunchpadCeleb rities) .ubuntu
> pss = getUtility( IProcessorFamil ySet) associations( self): restricted_ uassociations( self): (all(aa is None for aa in archivearches)) association( self): restricted_ association( self): IArchiveArchSet ).new(self. ppa, self.cell_proc)
> self.cell_proc = pss.new(
> 'cell-proc', 'PS cell processor', 'Screamingly faaaaaaaaaaaast',
> @@ -32,7 +35,7 @@
> 'omap', 'Multimedia applications processor',
> 'Does all your sound & video', True)
>
> - def test_no_
> + def test_no_
> """Our archive is not associated with any restricted processor
> families yet."""
> result_set = list(
> @@ -40,7 +43,7 @@
> archivearches = [row[1] for row in result_set]
> self.assertTrue
>
> - def test_single_
> + def test_single_
> """Our archive is now associated with one of the restricted processor
> families."""
> getUtility(
> @@ -52,6 +55,29 @@
> { 'arm' : False, 'cell-proc' : True, 'omap' : False},
Leading space. ^ Copied&pasted further down ... ;)
> results...