Merge lp:~michael.nelson/launchpad/638090-base_version-property-for-differences into lp:launchpad/db-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Stuart Bishop | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 9936 | ||||
Proposed branch: | lp:~michael.nelson/launchpad/638090-base_version-property-for-differences | ||||
Merge into: | lp:launchpad/db-devel | ||||
Diff against target: |
287 lines (+127/-40) 6 files modified
database/schema/comments.sql (+1/-0) database/schema/patch-2208-24-0.sql (+7/-0) lib/lp/registry/interfaces/distroseriesdifference.py (+7/-7) lib/lp/registry/model/distroseriesdifference.py (+42/-11) lib/lp/registry/tests/test_distroseriesdifference.py (+66/-3) lib/lp/testing/factory.py (+4/-19) |
||||
To merge this branch: | bzr merge lp:~michael.nelson/launchpad/638090-base_version-property-for-differences | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | db | Approve | |
Edwin Grubbs (community) | code | Approve | |
Robert Collins | db | Pending | |
Review via email: mp+37742@code.launchpad.net |
Commit message
Adds DistroSeriesDif
Description of the change
Overview
========
This branch adds the base_version column to the schema for DistroSeriesDif
Details
=======
It also updates the versions created by factory.
I've also simplified the factory for new distroseriesdif
Finally, removed a second factory.
To test:
bin/test -vvm test_distroseri
Hi Michael,
This branch looks good. I have included comments on the test changes that we already discussed on IRC.
-Edwin
>=== modified file 'lib/lp/ registry/ tests/test_ distroseriesdif ference. py' registry/ tests/test_ distroseriesdif ference. py 2010-09-22 11:03:20 +0000 registry/ tests/test_ distroseriesdif ference. py 2010-10-06 14:44:02 +0000 entEqual( source_ pub'], cache) version_ none(self) : makeDistroSerie sDifference( ) base_version) version_ common( self): makeDistroSerie s( series= self.factory. makeDistroSerie s()) getOrMakeSource PackageName( 'foo')
>--- lib/lp/
>+++ lib/lp/
>@@ -424,6 +422,38 @@
> self.assertCont
> ['source_pub', 'parent_
>
>+ def test_base_
>+ # The attribute is set to None if there is no common base version.
>+ ds_diff = self.factory.
>+
>+ self.assertIs(None, ds_diff.
>+
>+ def test_base_
>+ # The common base version is set when the difference is created.
>+ # Publish v1.0 of foo in both series.
>+ derived_series = self.factory.
>+ parent_
>+ source_package_name = self.factory.
The test should add multiple common versions to verify that it chooses
the right one (the latest one).
>+ self.factory. makeSourcePacka gePublishingHis tory( derived_ series, me=source_ package_ name, ngStatus. PUBLISHED)
>+ distroseries=
>+ version='1.0',
>+ sourcepackagena
>+ status = PackagePublishi
Remove spaces around "=".
>+ self.factory. makeSourcePacka gePublishingHis tory( derived_ series. parent_ series, me=source_ package_ name, ngStatus. PUBLISHED)
>+ distroseries=
>+ version='1.0',
>+ sourcepackagena
>+ status = PackagePublishi
Same here.
>+ ds_diff = self.factory. makeDistroSerie sDifference( series= derived_ series, source_ package_ name_str= 'foo', l('1.0' , ds_diff. base_version) ferenceSourceTe stCase( TestCaseWithFac tory):
>+ derived_
>+ versions={
>+ 'derived': '1.2',
>+ 'parent': '1.3',
>+ })
>+
>+ self.assertEqua
>+
>
> class DistroSeriesDif