Merge lp:~adiroiban/launchpad/bug-532239 into lp:launchpad

Proposed by Adi Roiban
Status: Work in progress
Proposed branch: lp:~adiroiban/launchpad/bug-532239
Merge into: lp:launchpad
Diff against target: 790 lines (+104/-164)
23 files modified
lib/canonical/launchpad/doc/vocabularies.txt (+2/-2)
lib/canonical/launchpad/xmlrpc/configure.zcml (+1/-5)
lib/canonical/launchpad/xmlrpc/faults.py (+7/-19)
lib/lp/code/interfaces/branchlookup.py (+3/-5)
lib/lp/code/interfaces/branchnamespace.py (+3/-5)
lib/lp/code/model/branchlookup.py (+6/-7)
lib/lp/code/model/branchnamespace.py (+3/-3)
lib/lp/code/model/linkedbranch.py (+2/-2)
lib/lp/code/model/tests/test_branchlookup.py (+7/-8)
lib/lp/code/model/tests/test_branchnamespace.py (+3/-3)
lib/lp/code/model/tests/test_linkedbranch.py (+2/-2)
lib/lp/code/xmlrpc/branch.py (+3/-7)
lib/lp/code/xmlrpc/tests/test_branch.py (+9/-9)
lib/lp/registry/interfaces/distroseries.py (+1/-35)
lib/lp/registry/interfaces/productseries.py (+0/-38)
lib/lp/registry/interfaces/series.py (+43/-3)
lib/lp/registry/model/distribution.py (+2/-2)
lib/lp/registry/model/distroseries.py (+0/-1)
lib/lp/registry/model/productseries.py (+0/-1)
lib/lp/registry/model/series.py (+1/-0)
lib/lp/registry/stories/webservice/xx-distribution.txt (+1/-1)
lib/lp/registry/tests/test_distribution.py (+2/-3)
lib/lp/registry/tests/test_distroseries.py (+3/-3)
To merge this branch: bzr merge lp:~adiroiban/launchpad/bug-532239
Reviewer Review Type Date Requested Status
Robert Collins (community) Needs Information
Review via email: mp+30108@code.launchpad.net

Commit message

Merge 'name' attribute in the common series mixin.

Description of the change

= Bug 532239 =
Since for solving bug 531261, moving name attribute would make the diff to big, I'm opening this bug to be fixed in a different branch.

We will also need to merge DistroSeriesNameField , NoSuchDistroSeries and ProductSeriesNameField , NoSuchProductSeries and the expcetion are used in many places.

== Proposed fix ==

Move name attribute in the common Series interface and mixin.

== Pre-implementation notes ==

I had a short chat with Sinzui and he agreed that merging NoSuchDistroSeries and NoSuchProductSeries into NoSuchSeries is a good idea.
He also volunteer to review this branch in case someone else thing it is too big.

== Implementation details ==

Name attribute is attached to a name validation which was raising

== Tests ==
./bin/test -t test_branchlookup -t test_branchnamespace -t test_linkedbranch -t test_branch -t test_distroseries -t test_distribution -t test_distribution -t vocabularie -t xx-distribution

== Demo and Q/A ==
Since this is a refactoring there is not much of QA and Demo.
Basically if you observe any changes, this branch is of not good :)

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

I have a few open questions here.

Firstly, we use the XMLRPC server from live servers. Will this / can this cause the existing users to handle errors wrongly (I think it can). If so, we'll have to do special rollouts for this change, which is a pain. Please consider how to avoid that (e.g. by landing a fix to the clients in advance of this change, in particular the fix would need to be CP'd in advance).

Secondly, you seem to be reducing the clarity of raised errors, and I don't see that as being an improvement. (By dropping the context that the missing thing is missing in).

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

Is there still interest in landing this?

Revision history for this message
Robert Collins (lifeless) wrote :

6 months with no reply, I'm moving this to work in progress. Adi, if/when you want to move it forward please just change the merge proposal status to needs review.

Unmerged revisions

10701. By Adi Roiban

Fix tests.

10700. By Adi Roiban

Merge devel.

10699. By Adi Roiban

Fix usage of NoSuchSeries as a replacement for NoSuchProductSeries.

10698. By Adi Roiban

Merge devel.

10697. By Adi Roiban

Initial changes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/canonical/launchpad/doc/vocabularies.txt'
--- lib/canonical/launchpad/doc/vocabularies.txt 2010-02-17 11:13:06 +0000
+++ lib/canonical/launchpad/doc/vocabularies.txt 2010-07-16 14:15:25 +0000
@@ -236,12 +236,12 @@
236 True236 True
237237
238Trying to get a non-existent release will result in a238Trying to get a non-existent release will result in a
239NoSuchDistroSeries error.239NoSuchSeries error.
240240
241 >>> series_vocabulary.getTermByToken('non-such-release')241 >>> series_vocabulary.getTermByToken('non-such-release')
242 Traceback (most recent call last):242 Traceback (most recent call last):
243 ...243 ...
244 NoSuchDistroSeries...244 NoSuchSeries...
245245
246246
247=== ProjectProductsVocabularyUsingMalone ===247=== ProjectProductsVocabularyUsingMalone ===
248248
=== modified file 'lib/canonical/launchpad/xmlrpc/configure.zcml'
--- lib/canonical/launchpad/xmlrpc/configure.zcml 2010-07-01 19:39:54 +0000
+++ lib/canonical/launchpad/xmlrpc/configure.zcml 2010-07-16 14:15:25 +0000
@@ -140,10 +140,6 @@
140 <require like_class="xmlrpclib.Fault" />140 <require like_class="xmlrpclib.Fault" />
141 </class>141 </class>
142142
143 <class class="canonical.launchpad.xmlrpc.faults.NoSuchProductSeries">
144 <require like_class="xmlrpclib.Fault" />
145 </class>
146
147 <class class="canonical.launchpad.xmlrpc.faults.InvalidBranchIdentifier">143 <class class="canonical.launchpad.xmlrpc.faults.InvalidBranchIdentifier">
148 <require like_class="xmlrpclib.Fault" />144 <require like_class="xmlrpclib.Fault" />
149 </class>145 </class>
@@ -196,7 +192,7 @@
196 <require like_class="xmlrpclib.Fault" />192 <require like_class="xmlrpclib.Fault" />
197 </class>193 </class>
198194
199 <class class="canonical.launchpad.xmlrpc.faults.NoSuchDistroSeries">195 <class class="canonical.launchpad.xmlrpc.faults.NoSuchSeries">
200 <require like_class="xmlrpclib.Fault" />196 <require like_class="xmlrpclib.Fault" />
201 </class>197 </class>
202198
203199
=== modified file 'lib/canonical/launchpad/xmlrpc/faults.py'
--- lib/canonical/launchpad/xmlrpc/faults.py 2010-07-02 12:10:21 +0000
+++ lib/canonical/launchpad/xmlrpc/faults.py 2010-07-16 14:15:25 +0000
@@ -32,7 +32,7 @@
32 'NoSuchPerson',32 'NoSuchPerson',
33 'NoSuchPersonWithName',33 'NoSuchPersonWithName',
34 'NoSuchProduct',34 'NoSuchProduct',
35 'NoSuchProductSeries',35 'NoSuchSeries',
36 'NoSuchTeamMailingList',36 'NoSuchTeamMailingList',
37 'NotInTeam',37 'NotInTeam',
38 'NoUrlForBranch',38 'NoUrlForBranch',
@@ -226,18 +226,6 @@
226 LaunchpadFault.__init__(self, object_name=component.displayname)226 LaunchpadFault.__init__(self, object_name=component.displayname)
227227
228228
229class NoSuchProductSeries(LaunchpadFault):
230 """There is no such series on a particular project."""
231
232 error_code = 180
233 msg_template = (
234 'Project %(product_name)s has no series called "%(series_name)s"')
235
236 def __init__(self, series_name, product):
237 LaunchpadFault.__init__(
238 self, series_name=series_name, product_name=product.name)
239
240
241class InvalidBranchIdentifier(LaunchpadFault):229class InvalidBranchIdentifier(LaunchpadFault):
242 """The branch identifier didn't begin with a tilde."""230 """The branch identifier didn't begin with a tilde."""
243231
@@ -419,15 +407,15 @@
419 LaunchpadFault.__init__(self, path=path)407 LaunchpadFault.__init__(self, path=path)
420408
421409
422class NoSuchDistroSeries(LaunchpadFault):410class NoSuchSeries(LaunchpadFault):
423 """Raised when the user tries to get a distroseries that doesn't exist."""411 """Raised when the user tries to get a series that doesn't exist."""
424412
425 error_code = 340413 error_code = 340
426 msg_template = "No such distribution series %(distroseries_name)s."414 msg_template = "No such series %(series_name)s."
427415
428 def __init__(self, distroseries_name):416 def __init__(self, series_name):
429 self.distroseries_name = distroseries_name417 self.series_name = series_name
430 LaunchpadFault.__init__(self, distroseries_name=distroseries_name)418 LaunchpadFault.__init__(self, series_name=series_name)
431419
432420
433class NoSuchSourcePackageName(LaunchpadFault):421class NoSuchSourcePackageName(LaunchpadFault):
434422
=== modified file 'lib/lp/code/interfaces/branchlookup.py'
--- lib/lp/code/interfaces/branchlookup.py 2009-11-19 15:46:10 +0000
+++ lib/lp/code/interfaces/branchlookup.py 2010-07-16 14:15:25 +0000
@@ -40,7 +40,7 @@
40 component of the path.40 component of the path.
41 :raises NoSuchProduct: If we can't find a product that matches the41 :raises NoSuchProduct: If we can't find a product that matches the
42 product component of the path.42 product component of the path.
43 :raises NoSuchProductSeries: If the series component doesn't match an43 :raises NoSuchSeries: If the series component doesn't match an
44 existing series.44 existing series.
45 :raises NoSuchSourcePackageName: If the source packagae referred to45 :raises NoSuchSourcePackageName: If the source packagae referred to
46 does not exist.46 does not exist.
@@ -131,10 +131,8 @@
131 component of the path.131 component of the path.
132 :raises NoSuchProduct: If we can't find a product that matches the132 :raises NoSuchProduct: If we can't find a product that matches the
133 product component of the path.133 product component of the path.
134 :raises NoSuchProductSeries: If the product series component doesn't134 :raises NoSuchSeries: If the series component doesn't match an
135 match an existing series.135 existing series.
136 :raises NoSuchDistroSeries: If the distro series component doesn't
137 match an existing series.
138 :raises NoSuchSourcePackageName: If the source packagae referred to136 :raises NoSuchSourcePackageName: If the source packagae referred to
139 does not exist.137 does not exist.
140138
141139
=== modified file 'lib/lp/code/interfaces/branchnamespace.py'
--- lib/lp/code/interfaces/branchnamespace.py 2009-08-13 15:12:16 +0000
+++ lib/lp/code/interfaces/branchnamespace.py 2010-07-16 14:15:25 +0000
@@ -188,8 +188,7 @@
188 :raise NoSuchProduct: if the product referred to cannot be found.188 :raise NoSuchProduct: if the product referred to cannot be found.
189 :raise NoSuchDistribution: if the distribution referred to cannot be189 :raise NoSuchDistribution: if the distribution referred to cannot be
190 found.190 found.
191 :raise NoSuchDistroSeries: if the distroseries referred to cannot be-191 :raise NoSuchSeries: if the series referred to cannot be found.
192 found.
193 :raise NoSuchSourcePackageName: if the sourcepackagename referred to192 :raise NoSuchSourcePackageName: if the sourcepackagename referred to
194 cannot be found.193 cannot be found.
195 :return: An `IBranchNamespace`.194 :return: An `IBranchNamespace`.
@@ -203,8 +202,7 @@
203 :raise NoSuchProduct: if the product referred to cannot be found.202 :raise NoSuchProduct: if the product referred to cannot be found.
204 :raise NoSuchDistribution: if the distribution referred to cannot be203 :raise NoSuchDistribution: if the distribution referred to cannot be
205 found.204 found.
206 :raise NoSuchDistroSeries: if the distroseries referred to cannot be-205 :raise NoSuchSeries: if the series referred to cannot be found.
207 found.
208 :raise NoSuchSourcePackageName: if the sourcepackagename referred to206 :raise NoSuchSourcePackageName: if the sourcepackagename referred to
209 cannot be found.207 cannot be found.
210 :return: An `IBranchNamespace`.208 :return: An `IBranchNamespace`.
@@ -273,7 +271,7 @@
273 found.271 found.
274 :raise NoSuchDistribution: if the distribution referred to cannot be272 :raise NoSuchDistribution: if the distribution referred to cannot be
275 found.273 found.
276 :raise NoSuchDistroSeries: if the distroseries referred to cannot be-274 :raise NoSuchSeries: if the series referred to cannot be-
277 found.275 found.
278 :raise NoSuchSourcePackageName: if the sourcepackagename referred to276 :raise NoSuchSourcePackageName: if the sourcepackagename referred to
279 cannot be found.277 cannot be found.
280278
=== modified file 'lib/lp/code/model/branchlookup.py'
--- lib/lp/code/model/branchlookup.py 2009-11-20 15:58:09 +0000
+++ lib/lp/code/model/branchlookup.py 2010-07-16 14:15:25 +0000
@@ -30,12 +30,12 @@
30 CannotHaveLinkedBranch, get_linked_branch, NoLinkedBranch)30 CannotHaveLinkedBranch, get_linked_branch, NoLinkedBranch)
31from lp.registry.interfaces.distribution import IDistribution31from lp.registry.interfaces.distribution import IDistribution
32from lp.registry.interfaces.distroseries import (32from lp.registry.interfaces.distroseries import (
33 IDistroSeries, IDistroSeriesSet, NoSuchDistroSeries)33 IDistroSeries, IDistroSeriesSet)
34from lp.registry.interfaces.person import NoSuchPerson34from lp.registry.interfaces.person import NoSuchPerson
35from lp.registry.interfaces.pillar import IPillarNameSet35from lp.registry.interfaces.pillar import IPillarNameSet
36from lp.registry.interfaces.product import (36from lp.registry.interfaces.product import (
37 InvalidProductName, IProduct, NoSuchProduct)37 InvalidProductName, IProduct, NoSuchProduct)
38from lp.registry.interfaces.productseries import NoSuchProductSeries38from lp.registry.interfaces.series import NoSuchSeries
39from lp.registry.interfaces.sourcepackagename import (39from lp.registry.interfaces.sourcepackagename import (
40 NoSuchSourcePackageName)40 NoSuchSourcePackageName)
41from lp.services.utils import iter_split41from lp.services.utils import iter_split
@@ -109,13 +109,13 @@
109 def traverse(self, name, segments):109 def traverse(self, name, segments):
110 """See `ITraversable`.110 """See `ITraversable`.
111111
112 :raises NoSuchProductSeries: if 'name' doesn't match an existing112 :raises NoSuchSeries: if 'name' doesn't match an existing
113 series.113 series.
114 :return: `IProductSeries`.114 :return: `IProductSeries`.
115 """115 """
116 series = self.context.getSeries(name)116 series = self.context.getSeries(name)
117 if series is None:117 if series is None:
118 raise NoSuchProductSeries(name, self.context)118 raise NoSuchSeries(name)
119 return series119 return series
120120
121121
@@ -132,7 +132,7 @@
132 """See `ITraversable`."""132 """See `ITraversable`."""
133 try:133 try:
134 return getUtility(IDistroSeriesSet).fromSuite(self.context, name)134 return getUtility(IDistroSeriesSet).fromSuite(self.context, name)
135 except NoSuchDistroSeries:135 except NoSuchSeries:
136 sourcepackage = self.context.getSourcePackage(name)136 sourcepackage = self.context.getSourcePackage(name)
137 if sourcepackage is None:137 if sourcepackage is None:
138 if segments:138 if segments:
@@ -233,8 +233,7 @@
233 except (233 except (
234 CannotHaveLinkedBranch, InvalidNamespace, InvalidProductName,234 CannotHaveLinkedBranch, InvalidNamespace, InvalidProductName,
235 NoSuchBranch, NoSuchPerson, NoSuchProduct,235 NoSuchBranch, NoSuchPerson, NoSuchProduct,
236 NoSuchProductSeries, NoSuchDistroSeries,236 NoSuchSeries, NoSuchSourcePackageName, NoLinkedBranch):
237 NoSuchSourcePackageName, NoLinkedBranch):
238 return None237 return None
239238
240 return Branch.selectOneBy(url=url)239 return Branch.selectOneBy(url=url)
241240
=== modified file 'lib/lp/code/model/branchnamespace.py'
--- lib/lp/code/model/branchnamespace.py 2010-05-25 04:16:25 +0000
+++ lib/lp/code/model/branchnamespace.py 2010-07-16 14:15:25 +0000
@@ -37,8 +37,8 @@
37from lp.code.model.branch import Branch37from lp.code.model.branch import Branch
38from lp.registry.interfaces.distribution import (38from lp.registry.interfaces.distribution import (
39 IDistributionSet, NoSuchDistribution)39 IDistributionSet, NoSuchDistribution)
40from lp.registry.interfaces.distroseries import (40from lp.registry.interfaces.series import NoSuchSeries
41 IDistroSeriesSet, NoSuchDistroSeries)41from lp.registry.interfaces.distroseries import IDistroSeriesSet
42from lp.registry.interfaces.person import IPersonSet, NoSuchPerson42from lp.registry.interfaces.person import IPersonSet, NoSuchPerson
43from lp.registry.interfaces.pillar import IPillarNameSet43from lp.registry.interfaces.pillar import IPillarNameSet
44from lp.registry.interfaces.projectgroup import IProjectGroup44from lp.registry.interfaces.projectgroup import IProjectGroup
@@ -585,7 +585,7 @@
585585
586 def _findDistroSeries(self, distribution, distroseries_name):586 def _findDistroSeries(self, distribution, distroseries_name):
587 return self._findOrRaise(587 return self._findOrRaise(
588 NoSuchDistroSeries, distroseries_name,588 NoSuchSeries, distroseries_name,
589 getUtility(IDistroSeriesSet).queryByName, distribution)589 getUtility(IDistroSeriesSet).queryByName, distribution)
590590
591 def _findSourcePackageName(self, sourcepackagename_name):591 def _findSourcePackageName(self, sourcepackagename_name):
592592
=== modified file 'lib/lp/code/model/linkedbranch.py'
--- lib/lp/code/model/linkedbranch.py 2010-04-09 01:46:52 +0000
+++ lib/lp/code/model/linkedbranch.py 2010-07-16 14:15:25 +0000
@@ -17,7 +17,7 @@
17from lp.code.interfaces.linkedbranch import ICanHasLinkedBranch17from lp.code.interfaces.linkedbranch import ICanHasLinkedBranch
18from lp.registry.interfaces.distributionsourcepackage import (18from lp.registry.interfaces.distributionsourcepackage import (
19 IDistributionSourcePackage)19 IDistributionSourcePackage)
20from lp.registry.interfaces.distroseries import NoSuchDistroSeries20from lp.registry.interfaces.series import NoSuchSeries
21from lp.registry.interfaces.pocket import PackagePublishingPocket21from lp.registry.interfaces.pocket import PackagePublishingPocket
22from lp.registry.interfaces.product import IProduct22from lp.registry.interfaces.product import IProduct
23from lp.registry.interfaces.productseries import IProductSeries23from lp.registry.interfaces.productseries import IProductSeries
@@ -230,7 +230,7 @@
230 development_package = (230 development_package = (
231 self.distribution_sourcepackage.development_version)231 self.distribution_sourcepackage.development_version)
232 if development_package is None:232 if development_package is None:
233 raise NoSuchDistroSeries('no current series')233 raise NoSuchSeries('no current series')
234 suite_sourcepackage = development_package.getSuiteSourcePackage(234 suite_sourcepackage = development_package.getSuiteSourcePackage(
235 PackagePublishingPocket.RELEASE)235 PackagePublishingPocket.RELEASE)
236 ICanHasLinkedBranch(suite_sourcepackage).setBranch(branch, registrant)236 ICanHasLinkedBranch(suite_sourcepackage).setBranch(branch, registrant)
237237
=== modified file 'lib/lp/code/model/tests/test_branchlookup.py'
--- lib/lp/code/model/tests/test_branchlookup.py 2010-04-16 15:06:55 +0000
+++ lib/lp/code/model/tests/test_branchlookup.py 2010-07-16 14:15:25 +0000
@@ -20,12 +20,11 @@
20 get_branch_namespace, InvalidNamespace)20 get_branch_namespace, InvalidNamespace)
21from lp.code.interfaces.linkedbranch import (21from lp.code.interfaces.linkedbranch import (
22 CannotHaveLinkedBranch, ICanHasLinkedBranch, NoLinkedBranch)22 CannotHaveLinkedBranch, ICanHasLinkedBranch, NoLinkedBranch)
23from lp.registry.interfaces.distroseries import NoSuchDistroSeries
24from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities23from canonical.launchpad.interfaces.launchpad import ILaunchpadCelebrities
25from lp.registry.interfaces.person import NoSuchPerson24from lp.registry.interfaces.person import NoSuchPerson
26from lp.registry.interfaces.product import (25from lp.registry.interfaces.product import (
27 InvalidProductName, NoSuchProduct)26 InvalidProductName, NoSuchProduct)
28from lp.registry.interfaces.productseries import NoSuchProductSeries27from lp.registry.interfaces.series import NoSuchSeries
29from lp.registry.interfaces.pocket import PackagePublishingPocket28from lp.registry.interfaces.pocket import PackagePublishingPocket
30from lp.registry.interfaces.sourcepackagename import (29from lp.registry.interfaces.sourcepackagename import (
31 NoSuchSourcePackageName)30 NoSuchSourcePackageName)
@@ -364,13 +363,13 @@
364 def test_error_fallthrough_product_series(self):363 def test_error_fallthrough_product_series(self):
365 # For the short name of a series branch, `traverse` raises364 # For the short name of a series branch, `traverse` raises
366 # `NoSuchProduct` if the first component refers to a non-existent365 # `NoSuchProduct` if the first component refers to a non-existent
367 # product, and `NoSuchProductSeries` if the second component refers to366 # product, and `NoSuchSeries` if the second component refers to
368 # a non-existent series.367 # a non-existent series.
369 self.assertRaises(368 self.assertRaises(
370 NoSuchProduct, self.traverser.traverse, 'bb/dd')369 NoSuchProduct, self.traverser.traverse, 'bb/dd')
371 self.factory.makeProduct(name='bb')370 self.factory.makeProduct(name='bb')
372 self.assertRaises(371 self.assertRaises(
373 NoSuchProductSeries, self.traverser.traverse, 'bb/dd')372 NoSuchSeries, self.traverser.traverse, 'bb/dd')
374373
375 def test_product_series(self):374 def test_product_series(self):
376 # `traverse` resolves the path to a product series to the product375 # `traverse` resolves the path to a product series to the product
@@ -428,11 +427,11 @@
428 'distro/series/package')427 'distro/series/package')
429428
430 def test_no_such_distro_series(self):429 def test_no_such_distro_series(self):
431 # `traverse` raises `NoSuchDistroSeries` if the distro series doesn't430 # `traverse` raises `NoSuchSeries` if the distro series doesn't
432 # exist.431 # exist.
433 self.factory.makeDistribution(name='distro')432 self.factory.makeDistribution(name='distro')
434 self.assertRaises(433 self.assertRaises(
435 NoSuchDistroSeries, self.traverser.traverse,434 NoSuchSeries, self.traverser.traverse,
436 'distro/series/package')435 'distro/series/package')
437436
438 def test_no_such_sourcepackagename(self):437 def test_no_such_sourcepackagename(self):
@@ -617,14 +616,14 @@
617 def test_too_long_product(self):616 def test_too_long_product(self):
618 # If the provided path points to an existing product with a linked617 # If the provided path points to an existing product with a linked
619 # branch but there are also extra path segments, then raise a618 # branch but there are also extra path segments, then raise a
620 # NoSuchProductSeries error, since we can't tell the difference619 # NoSuchSeries error, since we can't tell the difference
621 # between a trailing path and an attempt to load a non-existent series620 # between a trailing path and an attempt to load a non-existent series
622 # branch.621 # branch.
623 branch = self.factory.makeProductBranch()622 branch = self.factory.makeProductBranch()
624 product = removeSecurityProxy(branch.product)623 product = removeSecurityProxy(branch.product)
625 product.development_focus.branch = branch624 product.development_focus.branch = branch
626 self.assertRaises(625 self.assertRaises(
627 NoSuchProductSeries,626 NoSuchSeries,
628 self.branch_lookup.getByLPPath, '%s/other/bits' % product.name)627 self.branch_lookup.getByLPPath, '%s/other/bits' % product.name)
629628
630 def test_too_long_product_series(self):629 def test_too_long_product_series(self):
631630
=== modified file 'lib/lp/code/model/tests/test_branchnamespace.py'
--- lib/lp/code/model/tests/test_branchnamespace.py 2010-05-21 17:04:28 +0000
+++ lib/lp/code/model/tests/test_branchnamespace.py 2010-07-16 14:15:25 +0000
@@ -27,7 +27,7 @@
27 IBranchNamespaceSet, lookup_branch_namespace, InvalidNamespace)27 IBranchNamespaceSet, lookup_branch_namespace, InvalidNamespace)
28from lp.code.interfaces.branchtarget import IBranchTarget28from lp.code.interfaces.branchtarget import IBranchTarget
29from lp.registry.interfaces.distribution import NoSuchDistribution29from lp.registry.interfaces.distribution import NoSuchDistribution
30from lp.registry.interfaces.distroseries import NoSuchDistroSeries30from lp.registry.interfaces.series import NoSuchSeries
31from lp.registry.interfaces.person import NoSuchPerson31from lp.registry.interfaces.person import NoSuchPerson
32from lp.registry.interfaces.product import NoSuchProduct32from lp.registry.interfaces.product import NoSuchProduct
33from lp.registry.interfaces.sourcepackagename import (33from lp.registry.interfaces.sourcepackagename import (
@@ -527,7 +527,7 @@
527 person = self.factory.makePerson()527 person = self.factory.makePerson()
528 distribution = self.factory.makeDistribution()528 distribution = self.factory.makeDistribution()
529 self.assertRaises(529 self.assertRaises(
530 NoSuchDistroSeries, lookup_branch_namespace,530 NoSuchSeries, lookup_branch_namespace,
531 '~%s/%s/no-such-series/whocares'531 '~%s/%s/no-such-series/whocares'
532 % (person.name, distribution.name))532 % (person.name, distribution.name))
533533
@@ -769,7 +769,7 @@
769 segments = iter(769 segments = iter(
770 [person.name, distro.name, 'no-such-series', 'package', 'branch'])770 [person.name, distro.name, 'no-such-series', 'package', 'branch'])
771 self.assertRaises(771 self.assertRaises(
772 NoSuchDistroSeries, self.namespace_set.traverse, segments)772 NoSuchSeries, self.namespace_set.traverse, segments)
773 self.assertEqual(['package', 'branch'], list(segments))773 self.assertEqual(['package', 'branch'], list(segments))
774774
775 def test_traverse_sourcepackagename_not_found(self):775 def test_traverse_sourcepackagename_not_found(self):
776776
=== modified file 'lib/lp/code/model/tests/test_linkedbranch.py'
--- lib/lp/code/model/tests/test_linkedbranch.py 2010-04-16 15:06:55 +0000
+++ lib/lp/code/model/tests/test_linkedbranch.py 2010-07-16 14:15:25 +0000
@@ -15,7 +15,7 @@
15from canonical.testing.layers import DatabaseFunctionalLayer15from canonical.testing.layers import DatabaseFunctionalLayer
16from lp.code.interfaces.linkedbranch import (16from lp.code.interfaces.linkedbranch import (
17 CannotHaveLinkedBranch, get_linked_branch, ICanHasLinkedBranch)17 CannotHaveLinkedBranch, get_linked_branch, ICanHasLinkedBranch)
18from lp.registry.interfaces.distroseries import NoSuchDistroSeries18from lp.registry.interfaces.series import NoSuchSeries
19from lp.registry.interfaces.pocket import PackagePublishingPocket19from lp.registry.interfaces.pocket import PackagePublishingPocket
20from lp.testing import run_with_login, TestCaseWithFactory20from lp.testing import run_with_login, TestCaseWithFactory
2121
@@ -175,7 +175,7 @@
175 ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches175 ubuntu_branches = getUtility(ILaunchpadCelebrities).ubuntu_branches
176 registrant = ubuntu_branches.teamowner176 registrant = ubuntu_branches.teamowner
177 self.assertRaises(177 self.assertRaises(
178 NoSuchDistroSeries,178 NoSuchSeries,
179 linked_branch.setBranch, self.factory.makeAnyBranch(), registrant)179 linked_branch.setBranch, self.factory.makeAnyBranch(), registrant)
180180
181 def test_bzr_path(self):181 def test_bzr_path(self):
182182
=== modified file 'lib/lp/code/xmlrpc/branch.py'
--- lib/lp/code/xmlrpc/branch.py 2010-02-21 21:13:34 +0000
+++ lib/lp/code/xmlrpc/branch.py 2010-07-16 14:15:25 +0000
@@ -31,11 +31,10 @@
31 get_branch_namespace, InvalidNamespace)31 get_branch_namespace, InvalidNamespace)
32from lp.code.interfaces.linkedbranch import (32from lp.code.interfaces.linkedbranch import (
33 CannotHaveLinkedBranch, NoLinkedBranch)33 CannotHaveLinkedBranch, NoLinkedBranch)
34from lp.registry.interfaces.distroseries import NoSuchDistroSeries
35from lp.registry.interfaces.person import NoSuchPerson34from lp.registry.interfaces.person import NoSuchPerson
36from lp.registry.interfaces.product import (35from lp.registry.interfaces.product import (
37 InvalidProductName, NoSuchProduct)36 InvalidProductName, NoSuchProduct)
38from lp.registry.interfaces.productseries import NoSuchProductSeries37from lp.registry.interfaces.series import NoSuchSeries
39from lp.registry.interfaces.sourcepackagename import (38from lp.registry.interfaces.sourcepackagename import (
40 NoSuchSourcePackageName)39 NoSuchSourcePackageName)
41from canonical.launchpad.validators import LaunchpadValidationError40from canonical.launchpad.validators import LaunchpadValidationError
@@ -241,15 +240,12 @@
241 # or using a narrower range of faults (e.g. only one "NoSuch" fault).240 # or using a narrower range of faults (e.g. only one "NoSuch" fault).
242 except InvalidProductName, e:241 except InvalidProductName, e:
243 raise faults.InvalidProductIdentifier(urlutils.escape(e.name))242 raise faults.InvalidProductIdentifier(urlutils.escape(e.name))
244 except NoSuchProductSeries, e:
245 raise faults.NoSuchProductSeries(
246 urlutils.escape(e.name), e.product)
247 except NoSuchPerson, e:243 except NoSuchPerson, e:
248 raise faults.NoSuchPersonWithName(urlutils.escape(e.name))244 raise faults.NoSuchPersonWithName(urlutils.escape(e.name))
249 except NoSuchProduct, e:245 except NoSuchProduct, e:
250 raise faults.NoSuchProduct(urlutils.escape(e.name))246 raise faults.NoSuchProduct(urlutils.escape(e.name))
251 except NoSuchDistroSeries, e:247 except NoSuchSeries, e:
252 raise faults.NoSuchDistroSeries(urlutils.escape(e.name))248 raise faults.NoSuchSeries(urlutils.escape(e.name))
253 except NoSuchSourcePackageName, e:249 except NoSuchSourcePackageName, e:
254 raise faults.NoSuchSourcePackageName(urlutils.escape(e.name))250 raise faults.NoSuchSourcePackageName(urlutils.escape(e.name))
255 except NoLinkedBranch, e:251 except NoLinkedBranch, e:
256252
=== modified file 'lib/lp/code/xmlrpc/tests/test_branch.py'
--- lib/lp/code/xmlrpc/tests/test_branch.py 2010-04-09 12:58:01 +0000
+++ lib/lp/code/xmlrpc/tests/test_branch.py 2010-07-16 14:15:25 +0000
@@ -192,35 +192,35 @@
192 faults.NoLinkedBranch(series))192 faults.NoLinkedBranch(series))
193193
194 def test_no_such_product_series(self):194 def test_no_such_product_series(self):
195 # Return a NoSuchProductSeries fault if there is no series of the195 # Return a NoSuchSeries fault if there is no series of the
196 # given name associated with the product.196 # given name associated with the product.
197 self.assertFault(197 self.assertFault(
198 '%s/%s' % (self.product.name, "doesntexist"),198 '%s/%s' % (self.product.name, "doesntexist"),
199 faults.NoSuchProductSeries("doesntexist", self.product))199 faults.NoSuchSeries("doesntexist"))
200200
201 def test_no_such_product_series_non_ascii(self):201 def test_no_such_product_series_non_ascii(self):
202 # lp:product/<non-ascii-string> returns NoSuchProductSeries with the202 # lp:product/<non-ascii-string> returns NoSuchSeries with the
203 # name escaped.203 # name escaped.
204 self.assertFault(204 self.assertFault(
205 '%s/%s' % (self.product.name, NON_ASCII_NAME),205 '%s/%s' % (self.product.name, NON_ASCII_NAME),
206 faults.NoSuchProductSeries(206 faults.NoSuchSeries(
207 urlutils.escape(NON_ASCII_NAME), self.product))207 urlutils.escape(NON_ASCII_NAME)))
208208
209 def test_no_such_distro_series(self):209 def test_no_such_distro_series(self):
210 # Return a NoSuchDistroSeries fault if there is no series of the given210 # Return a NoSuchSeries fault if there is no series of the given
211 # name on that distribution.211 # name on that distribution.
212 distro = self.factory.makeDistribution()212 distro = self.factory.makeDistribution()
213 self.assertFault(213 self.assertFault(
214 '%s/doesntexist/whocares' % distro.name,214 '%s/doesntexist/whocares' % distro.name,
215 faults.NoSuchDistroSeries("doesntexist"))215 faults.NoSuchSeries("doesntexist"))
216216
217 def test_no_such_distro_series_non_ascii(self):217 def test_no_such_distro_series_non_ascii(self):
218 # lp:distro/<non-ascii-string>/whatever returns NoSuchDistroSeries218 # lp:distro/<non-ascii-string>/whatever returns NoSuchSeries
219 # with the name escaped.219 # with the name escaped.
220 distro = self.factory.makeDistribution()220 distro = self.factory.makeDistribution()
221 self.assertFault(221 self.assertFault(
222 '%s/%s/whocares' % (distro.name, NON_ASCII_NAME),222 '%s/%s/whocares' % (distro.name, NON_ASCII_NAME),
223 faults.NoSuchDistroSeries(urlutils.escape(NON_ASCII_NAME)))223 faults.NoSuchSeries(urlutils.escape(NON_ASCII_NAME)))
224224
225 def test_no_such_source_package(self):225 def test_no_such_source_package(self):
226 # Return a NoSuchSourcePackageName fault if there is no source package226 # Return a NoSuchSourcePackageName fault if there is no source package
227227
=== modified file 'lib/lp/registry/interfaces/distroseries.py'
--- lib/lp/registry/interfaces/distroseries.py 2010-06-08 15:58:04 +0000
+++ lib/lp/registry/interfaces/distroseries.py 2010-07-16 14:15:25 +0000
@@ -12,7 +12,6 @@
12 'IDistroSeriesEditRestricted',12 'IDistroSeriesEditRestricted',
13 'IDistroSeriesPublic',13 'IDistroSeriesPublic',
14 'IDistroSeriesSet',14 'IDistroSeriesSet',
15 'NoSuchDistroSeries',
16 ]15 ]
1716
18from zope.component import getUtility17from zope.component import getUtility
@@ -53,28 +52,6 @@
53from lp.translations.interfaces.languagepack import ILanguagePack52from lp.translations.interfaces.languagepack import ILanguagePack
54from lp.translations.interfaces.potemplate import IHasTranslationTemplates53from lp.translations.interfaces.potemplate import IHasTranslationTemplates
5554
56
57class DistroSeriesNameField(ContentNameField):
58 """A class to ensure `IDistroSeries` has unique names."""
59 errormessage = _("%s is already in use by another series.")
60
61 @property
62 def _content_iface(self):
63 """See `IField`."""
64 return IDistroSeries
65
66 def _getByName(self, name):
67 """See `IField`."""
68 try:
69 if self._content_iface.providedBy(self.context):
70 return self.context.distribution.getSeries(name)
71 else:
72 return self.context.getSeries(name)
73 except NoSuchDistroSeries:
74 # The name is available for the new series.
75 return None
76
77
78class DistroSeriesVersionField(UniqueField):55class DistroSeriesVersionField(UniqueField):
79 """A class to ensure `IDistroSeries` has unique versions."""56 """A class to ensure `IDistroSeries` has unique versions."""
80 errormessage = _(57 errormessage = _(
@@ -147,11 +124,7 @@
147 """Public IDistroSeries properties."""124 """Public IDistroSeries properties."""
148125
149 id = Attribute("The distroseries's unique number.")126 id = Attribute("The distroseries's unique number.")
150 name = exported(127
151 DistroSeriesNameField(
152 title=_("Name"), required=True,
153 description=_("The name of this series."),
154 constraint=name_validator))
155 displayname = exported(128 displayname = exported(
156 TextLine(129 TextLine(
157 title=_("Display name"), required=True,130 title=_("Display name"), required=True,
@@ -855,12 +828,5 @@
855 released == None will do no filtering on status.828 released == None will do no filtering on status.
856 """829 """
857830
858
859class NoSuchDistroSeries(NameLookupFailed):
860 """Raised when we try to find a DistroSeries that doesn't exist."""
861 webservice_error(400) #Bad request.
862 _message_prefix = "No such distribution series"
863
864
865# Monkey patch for circular import avoidance done in831# Monkey patch for circular import avoidance done in
866# _schema_circular_imports.py832# _schema_circular_imports.py
867833
=== modified file 'lib/lp/registry/interfaces/productseries.py'
--- lib/lp/registry/interfaces/productseries.py 2010-06-11 18:05:59 +0000
+++ lib/lp/registry/interfaces/productseries.py 2010-07-16 14:15:25 +0000
@@ -12,7 +12,6 @@
12 'IProductSeriesEditRestricted',12 'IProductSeriesEditRestricted',
13 'IProductSeriesPublic',13 'IProductSeriesPublic',
14 'IProductSeriesSet',14 'IProductSeriesSet',
15 'NoSuchProductSeries',
16 ]15 ]
1716
18from zope.schema import Bool, Choice, Datetime, Int, TextLine17from zope.schema import Bool, Choice, Datetime, Int, TextLine
@@ -51,23 +50,6 @@
51 rename_parameters_as)50 rename_parameters_as)
5251
5352
54class ProductSeriesNameField(ContentNameField):
55 """A class to ensure `IProductSeries` has unique names."""
56 errormessage = _("%s is already in use by another series.")
57
58 @property
59 def _content_iface(self):
60 """See `IField`."""
61 return IProductSeries
62
63 def _getByName(self, name):
64 """See `IField`."""
65 if self._content_iface.providedBy(self.context):
66 return self.context.product.getSeries(name)
67 else:
68 return self.context.getSeries(name)
69
70
71def validate_release_glob(value):53def validate_release_glob(value):
72 """Validate that the URL is supported."""54 """Validate that the URL is supported."""
73 parts = urlparse(value)55 parts = urlparse(value)
@@ -112,16 +94,6 @@
11294
113 parent = Attribute('The structural parent of this series - the product')95 parent = Attribute('The structural parent of this series - the product')
11496
115 name = exported(
116 ProductSeriesNameField(
117 title=_('Name'),
118 description=_(
119 "The name of the series is a short, unique name "
120 "that identifies it, being used in URLs. It must be all "
121 "lowercase, with no special characters. For example, '2.0' "
122 "or 'trunk'."),
123 constraint=name_validator))
124
125 datecreated = exported(97 datecreated = exported(
126 Datetime(title=_('Date Registered'),98 Datetime(title=_('Date Registered'),
127 required=True,99 required=True,
@@ -318,13 +290,3 @@
318 :param force_translations_upload: Actually ignore if translations are290 :param force_translations_upload: Actually ignore if translations are
319 enabled for this series.291 enabled for this series.
320 """292 """
321
322
323class NoSuchProductSeries(NameLookupFailed):
324 """Raised when we try to find a product that doesn't exist."""
325
326 _message_prefix = "No such product series"
327
328 def __init__(self, name, product, message=None):
329 NameLookupFailed.__init__(self, name, message)
330 self.product = product
331293
=== modified file 'lib/lp/registry/interfaces/series.py'
--- lib/lp/registry/interfaces/series.py 2010-05-17 09:35:18 +0000
+++ lib/lp/registry/interfaces/series.py 2010-07-16 14:15:25 +0000
@@ -8,20 +8,23 @@
8__metaclass__ = type8__metaclass__ = type
99
10__all__ = [10__all__ = [
11 'ISeriesMixin',
12 'NoSuchSeries',
11 'SeriesStatus',13 'SeriesStatus',
12 'ISeriesMixin',
13 ]14 ]
1415
15from zope.schema import Bool16from zope.schema import Bool
1617
17from lazr.enum import DBEnumeratedType, DBItem18from lazr.enum import DBEnumeratedType, DBItem
18from lazr.restful.fields import CollectionField, Reference19from lazr.restful.fields import CollectionField, Reference
19from lazr.restful.declarations import exported20from lazr.restful.declarations import exported, webservice_error
2021
21from canonical.launchpad import _22from canonical.launchpad import _
22from canonical.launchpad.fields import (23from canonical.launchpad.fields import (
23 PublicPersonChoice, Summary)24 ContentNameField, PublicPersonChoice, Summary)
24from canonical.launchpad.interfaces.launchpad import IHasDrivers25from canonical.launchpad.interfaces.launchpad import IHasDrivers
26from canonical.launchpad.validators.name import name_validator
27from canonical.launchpad.webapp.interfaces import NameLookupFailed
25from lp.registry.interfaces.person import IPerson28from lp.registry.interfaces.person import IPerson
2629
2730
@@ -89,6 +92,33 @@
89 """)92 """)
9093
9194
95class NoSuchSeries(NameLookupFailed):
96 """Raised when we try to find a series that doesn't exist."""
97 webservice_error(400) #Bad request.
98 _message_prefix = "No such series"
99
100
101class SeriesNameField(ContentNameField):
102 """A class to ensure an series has an unique name."""
103 errormessage = _("%s is already in use by another series.")
104
105 @property
106 def _content_iface(self):
107 """See `IField`."""
108 return ISeriesMixin
109
110 def _getByName(self, name):
111 """See `IField`."""
112 try:
113 if self._content_iface.providedBy(self.context):
114 return self.context.parent.getSeries(name)
115 else:
116 return self.context.getSeries(name)
117 except NoSuchSeries:
118 # The name is available for the new series.
119 return None
120
121
92class ISeriesMixin(IHasDrivers):122class ISeriesMixin(IHasDrivers):
93 """Methods & properties shared between distro & product series."""123 """Methods & properties shared between distro & product series."""
94124
@@ -99,6 +129,16 @@
99 "under current development. This excludes series which "129 "under current development. This excludes series which "
100 "are experimental or obsolete.")))130 "are experimental or obsolete.")))
101131
132 name = exported(
133 SeriesNameField(
134 title=_('Name'),
135 description=_(
136 "The name of the series is a short, unique name "
137 "that identifies it, being used in URLs. It must be all "
138 "lowercase, with no special characters. For example, '2.0', "
139 "'hardy' or 'trunk'."),
140 constraint=name_validator))
141
102 summary = exported(142 summary = exported(
103 Summary(title=_("Summary"),143 Summary(title=_("Summary"),
104 description=_('A single paragraph that explains the goals of '144 description=_('A single paragraph that explains the goals of '
105145
=== modified file 'lib/lp/registry/model/distribution.py'
--- lib/lp/registry/model/distribution.py 2010-06-29 10:17:06 +0000
+++ lib/lp/registry/model/distribution.py 2010-07-16 14:15:25 +0000
@@ -90,7 +90,7 @@
90from lp.registry.interfaces.distributionmirror import (90from lp.registry.interfaces.distributionmirror import (
91 IDistributionMirror, MirrorContent, MirrorStatus)91 IDistributionMirror, MirrorContent, MirrorStatus)
92from lp.registry.interfaces.series import SeriesStatus92from lp.registry.interfaces.series import SeriesStatus
93from lp.registry.interfaces.distroseries import NoSuchDistroSeries93from lp.registry.interfaces.series import NoSuchSeries
94from canonical.launchpad.interfaces.launchpad import (94from canonical.launchpad.interfaces.launchpad import (
95 IHasIcon, IHasLogo, IHasMugshot, ILaunchpadCelebrities, ILaunchpadUsage)95 IHasIcon, IHasLogo, IHasMugshot, ILaunchpadCelebrities, ILaunchpadUsage)
96from lp.soyuz.interfaces.queue import PackageUploadStatus96from lp.soyuz.interfaces.queue import PackageUploadStatus
@@ -529,7 +529,7 @@
529 DistroSeries.version == name_or_version),529 DistroSeries.version == name_or_version),
530 DistroSeries.distribution == self).one()530 DistroSeries.distribution == self).one()
531 if not distroseries:531 if not distroseries:
532 raise NoSuchDistroSeries(name_or_version)532 raise NoSuchSeries(name_or_version)
533 return distroseries533 return distroseries
534534
535 def getDevelopmentSeries(self):535 def getDevelopmentSeries(self):
536536
=== modified file 'lib/lp/registry/model/distroseries.py'
--- lib/lp/registry/model/distroseries.py 2010-06-22 19:42:51 +0000
+++ lib/lp/registry/model/distroseries.py 2010-07-16 14:15:25 +0000
@@ -136,7 +136,6 @@
136136
137 distribution = ForeignKey(137 distribution = ForeignKey(
138 dbName='distribution', foreignKey='Distribution', notNull=True)138 dbName='distribution', foreignKey='Distribution', notNull=True)
139 name = StringCol(notNull=True)
140 displayname = StringCol(notNull=True)139 displayname = StringCol(notNull=True)
141 title = StringCol(notNull=True)140 title = StringCol(notNull=True)
142 description = StringCol(notNull=True)141 description = StringCol(notNull=True)
143142
=== modified file 'lib/lp/registry/model/productseries.py'
--- lib/lp/registry/model/productseries.py 2010-06-09 08:26:26 +0000
+++ lib/lp/registry/model/productseries.py 2010-07-16 14:15:25 +0000
@@ -91,7 +91,6 @@
91 status = EnumCol(91 status = EnumCol(
92 notNull=True, schema=SeriesStatus,92 notNull=True, schema=SeriesStatus,
93 default=SeriesStatus.DEVELOPMENT)93 default=SeriesStatus.DEVELOPMENT)
94 name = StringCol(notNull=True)
95 datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW)94 datecreated = UtcDateTimeCol(notNull=True, default=UTC_NOW)
96 owner = ForeignKey(95 owner = ForeignKey(
97 dbName="owner", foreignKey="Person",96 dbName="owner", foreignKey="Person",
9897
=== modified file 'lib/lp/registry/model/series.py'
--- lib/lp/registry/model/series.py 2010-05-17 09:35:18 +0000
+++ lib/lp/registry/model/series.py 2010-07-16 14:15:25 +0000
@@ -22,6 +22,7 @@
2222
23 implements(ISeriesMixin)23 implements(ISeriesMixin)
2424
25 name = StringCol(notNull=True)
25 summary = StringCol(notNull=True)26 summary = StringCol(notNull=True)
2627
27 @property28 @property
2829
=== modified file 'lib/lp/registry/stories/webservice/xx-distribution.txt'
--- lib/lp/registry/stories/webservice/xx-distribution.txt 2010-06-09 08:26:26 +0000
+++ lib/lp/registry/stories/webservice/xx-distribution.txt 2010-07-16 14:15:25 +0000
@@ -69,7 +69,7 @@
69 ... name_or_version='fnord')69 ... name_or_version='fnord')
70 HTTP/1.1 400 Bad Request70 HTTP/1.1 400 Bad Request
71 ...71 ...
72 NoSuchDistroSeries: No such distribution series: 'fnord'.72 NoSuchSeries: No such series: 'fnord'.
7373
74"getDevelopmentSeries" returns all the distribution series for the74"getDevelopmentSeries" returns all the distribution series for the
75distribution that are marked as in development.75distribution that are marked as in development.
7676
=== modified file 'lib/lp/registry/tests/test_distribution.py'
--- lib/lp/registry/tests/test_distribution.py 2010-06-21 13:33:36 +0000
+++ lib/lp/registry/tests/test_distribution.py 2010-07-16 14:15:25 +0000
@@ -11,8 +11,7 @@
1111
12from lp.registry.tests.test_distroseries import (12from lp.registry.tests.test_distroseries import (
13 TestDistroSeriesCurrentSourceReleases)13 TestDistroSeriesCurrentSourceReleases)
14from lp.registry.interfaces.distroseries import NoSuchDistroSeries14from lp.registry.interfaces.series import NoSuchSeries, SeriesStatus
15from lp.registry.interfaces.series import SeriesStatus
16from lp.soyuz.interfaces.distributionsourcepackagerelease import (15from lp.soyuz.interfaces.distributionsourcepackagerelease import (
17 IDistributionSourcePackageRelease)16 IDistributionSourcePackageRelease)
18from lp.testing import TestCaseWithFactory17from lp.testing import TestCaseWithFactory
@@ -129,7 +128,7 @@
129128
130 def test_get_none(self):129 def test_get_none(self):
131 distro = self.factory.makeDistribution()130 distro = self.factory.makeDistribution()
132 self.assertRaises(NoSuchDistroSeries, distro.getSeries, "astronomy")131 self.assertRaises(NoSuchSeries, distro.getSeries, "astronomy")
133132
134 def test_get_by_name(self):133 def test_get_by_name(self):
135 distro = self.factory.makeDistribution()134 distro = self.factory.makeDistribution()
136135
=== modified file 'lib/lp/registry/tests/test_distroseries.py'
--- lib/lp/registry/tests/test_distroseries.py 2010-06-23 23:23:28 +0000
+++ lib/lp/registry/tests/test_distroseries.py 2010-07-16 14:15:25 +0000
@@ -14,8 +14,8 @@
1414
15from canonical.launchpad.ftests import ANONYMOUS, login15from canonical.launchpad.ftests import ANONYMOUS, login
16from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet16from lp.soyuz.interfaces.archive import ArchivePurpose, IArchiveSet
17from lp.registry.interfaces.distroseries import (17from lp.registry.interfaces.series import NoSuchSeries
18 IDistroSeriesSet, NoSuchDistroSeries)18from lp.registry.interfaces.distroseries import IDistroSeriesSet
19from lp.registry.interfaces.pocket import PackagePublishingPocket19from lp.registry.interfaces.pocket import PackagePublishingPocket
20from lp.soyuz.interfaces.component import IComponentSet20from lp.soyuz.interfaces.component import IComponentSet
21from lp.soyuz.interfaces.distroseriessourcepackagerelease import (21from lp.soyuz.interfaces.distroseriessourcepackagerelease import (
@@ -390,7 +390,7 @@
390 def test_fromSuite_no_such_series(self):390 def test_fromSuite_no_such_series(self):
391 distribution = self.factory.makeDistribution()391 distribution = self.factory.makeDistribution()
392 self.assertRaises(392 self.assertRaises(
393 NoSuchDistroSeries,393 NoSuchSeries,
394 getUtility(IDistroSeriesSet).fromSuite,394 getUtility(IDistroSeriesSet).fromSuite,
395 distribution, 'doesntexist')395 distribution, 'doesntexist')
396396