← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~ivo-kracht/launchpad/bug-897571 into lp:launchpad

 

Ivo Kracht has proposed merging lp:~ivo-kracht/launchpad/bug-897571 into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ivo-kracht/launchpad/bug-897571/+merge/111367

I wrote a test to confirm that “ISourcePackage.getSharingDetailPermissions specifies more parameters than SourcePackage.getSharingDetailPermissions actually supports” like the description said. It turned out to be a little bit more complicated. The test failed because of some weird attribute definitions that did not make any sense and don't seem to be related to anything, so I deleted them. After that the test failed because of the actual problem with IsoucePackage.getSharingDetailPermissions as it should and I just changed it so that it worked.

Pre-imp call with adeuring

test:
./bin/test registry -vvt test_sourcepackage

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/registry/tests/test_sourcepackage.py

-- 
https://code.launchpad.net/~ivo-kracht/launchpad/bug-897571/+merge/111367
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~ivo-kracht/launchpad/bug-897571 into lp:launchpad.
=== modified file 'lib/lp/registry/interfaces/sourcepackage.py'
--- lib/lp/registry/interfaces/sourcepackage.py	2011-12-24 16:54:44 +0000
+++ lib/lp/registry/interfaces/sourcepackage.py	2012-06-21 09:34:40 +0000
@@ -77,8 +77,6 @@
                            IHasDrivers, IHasOwner):
     """Public attributes for SourcePackage."""
 
-    id = Attribute("ID")
-
     name = exported(
         TextLine(
             title=_("Name"), required=True, readonly=True,
@@ -122,13 +120,6 @@
 
     sourcepackagename = Attribute("SourcePackageName")
 
-    bugtasks = Attribute("Bug Tasks that reference this Source Package name "
-                    "in the context of this distribution.")
-
-    product = Attribute(
-        "The best guess we have as to the Launchpad Project associated with "
-        "this SourcePackage.")
-
     # This is really a reference to an IProductSeries.
     productseries = exported(
         ReferenceChoice(
@@ -232,7 +223,7 @@
     def deletePackaging():
         """Delete the packaging for this sourcepackage."""
 
-    def getSharingDetailPermissions(self):
+    def getSharingDetailPermissions():
         """Return a dictionary of user permissions for +sharing-details page.
 
         This shows whether the user can change
@@ -274,11 +265,6 @@
         :return: An `IBranch`.
         """
 
-    shouldimport = Attribute("""Whether we should import this or not.
-        By 'import' we mean sourcerer analysis resulting in a manifest and a
-        set of Bazaar branches which describe the source package release.
-        The attribute is True or False.""")
-
     latest_published_component = Object(
         title=u'The component in which the package was last published.',
         schema=IComponent, readonly=True, required=False)

=== modified file 'lib/lp/registry/tests/test_sourcepackage.py'
--- lib/lp/registry/tests/test_sourcepackage.py	2012-01-01 02:58:52 +0000
+++ lib/lp/registry/tests/test_sourcepackage.py	2012-06-21 09:34:40 +0000
@@ -15,6 +15,8 @@
 from zope.security.checker import canAccess
 from zope.security.interfaces import Unauthorized
 from zope.security.management import checkPermission
+from zope.security.proxy import removeSecurityProxy
+from zope.interface.verify import verifyObject
 
 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
 from lp.code.model.seriessourcepackagebranch import (
@@ -23,6 +25,7 @@
 from lp.registry.interfaces.distribution import NoPartnerArchive
 from lp.registry.interfaces.pocket import PackagePublishingPocket
 from lp.registry.interfaces.series import SeriesStatus
+from lp.registry.interfaces.sourcepackage import ISourcePackage
 from lp.registry.model.distributionsourcepackage import (
     DistributionSourcePackage,
     )
@@ -46,6 +49,10 @@
 
     layer = DatabaseFunctionalLayer
 
+    def test_interface_consistancy(self):
+        package = self.factory.makeSourcePackage()
+        verifyObject(ISourcePackage, removeSecurityProxy(package))
+
     def test_path(self):
         sourcepackage = self.factory.makeSourcePackage()
         self.assertEqual(


Follow ups