← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/bpph-is-debug into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/bpph-is-debug into lp:launchpad.

Commit message:
Add BPPH.is_debug, indicating whether it's a DDEB publication. Archive admin tools need to know when to ignore them.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/bpph-is-debug/+merge/166416

Add BPPH.is_debug, indicating whether it's a DDEB publication. Archive admin tools need to know when to ignore them.
-- 
https://code.launchpad.net/~wgrant/launchpad/bpph-is-debug/+merge/166416
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/bpph-is-debug into lp:launchpad.
=== modified file 'lib/lp/soyuz/interfaces/publishing.py'
--- lib/lp/soyuz/interfaces/publishing.py	2013-05-27 07:58:22 +0000
+++ lib/lp/soyuz/interfaces/publishing.py	2013-05-30 00:59:31 +0000
@@ -871,6 +871,12 @@
         TextLine(
             title=_("Priority Name"),
             required=False, readonly=True))
+    is_debug = exported(
+        Bool(
+            title=_("Debug Package"),
+            description=_("Is this a debug package publication?"),
+            required=False, readonly=True),
+        as_of="devel")
 
     def supersede(dominant=None, logger=None):
         """Supersede this publication.

=== modified file 'lib/lp/soyuz/model/publishing.py'
--- lib/lp/soyuz/model/publishing.py	2013-05-29 07:24:13 +0000
+++ lib/lp/soyuz/model/publishing.py	2013-05-30 00:59:31 +0000
@@ -973,6 +973,13 @@
         return self.binarypackagerelease.architecturespecific
 
     @property
+    def is_debug(self):
+        """See `IBinaryPackagePublishingHistory`."""
+        return (
+            self.binarypackagerelease.binpackageformat
+            == BinaryPackageFormat.DDEB)
+
+    @property
     def priority_name(self):
         """See `IBinaryPackagePublishingHistory`"""
         return self.priority.name

=== modified file 'lib/lp/soyuz/tests/test_publishing_models.py'
--- lib/lp/soyuz/tests/test_publishing_models.py	2013-05-23 07:06:42 +0000
+++ lib/lp/soyuz/tests/test_publishing_models.py	2013-05-30 00:59:31 +0000
@@ -9,7 +9,10 @@
 from lp.buildmaster.enums import BuildStatus
 from lp.services.librarian.browser import ProxiedLibraryFileAlias
 from lp.services.webapp.publisher import canonical_url
-from lp.soyuz.enums import BinaryPackageFileType
+from lp.soyuz.enums import (
+    BinaryPackageFileType,
+    BinaryPackageFormat,
+    )
 from lp.soyuz.interfaces.publishing import (
     IPublishingSet,
     PackagePublishingStatus,
@@ -208,3 +211,13 @@
 
         self.assertContentEqual(
             self.get_urls_for_bpph(bpph, include_meta=True), urls)
+
+    def test_is_debug_false_for_deb(self):
+        bpph = self.factory.makeBinaryPackagePublishingHistory(
+            binpackageformat=BinaryPackageFormat.DEB)
+        self.assertFalse(bpph.is_debug)
+
+    def test_is_debug_true_for_ddeb(self):
+        bpph = self.factory.makeBinaryPackagePublishingHistory(
+            binpackageformat=BinaryPackageFormat.DDEB)
+        self.assertTrue(bpph.is_debug)