← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~stevenk/launchpad/ifp-use-istore into lp:launchpad/devel

 

Steve Kowalik has proposed merging lp:~stevenk/launchpad/ifp-use-istore into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


This branch switches IDS and its tests from using the deprecated IStoreSelector to using the much shinier I{Master,}Store. I also drove-by some import cleanups.
-- 
https://code.launchpad.net/~stevenk/launchpad/ifp-use-istore/+merge/34047
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/ifp-use-istore into lp:launchpad/devel.
=== modified file 'lib/lp/soyuz/scripts/initialise_distroseries.py'
--- lib/lp/soyuz/scripts/initialise_distroseries.py	2010-08-27 11:19:54 +0000
+++ lib/lp/soyuz/scripts/initialise_distroseries.py	2010-08-30 07:13:44 +0000
@@ -13,13 +13,20 @@
 from zope.component import getUtility
 
 from canonical.database.sqlbase import sqlvalues
+<<<<<<< TREE
 from canonical.launchpad.webapp.interfaces import (
     IStoreSelector,
     MAIN_STORE,
     MASTER_FLAVOR,
     )
 from lp.buildmaster.enums import BuildStatus
+=======
+from canonical.launchpad.interfaces.lpstorm import IMasterStore
+
+from lp.buildmaster.interfaces.buildbase import BuildStatus
+>>>>>>> MERGE-SOURCE
 from lp.registry.interfaces.pocket import PackagePublishingPocket
+from lp.registry.model.distroseries import DistroSeries
 from lp.soyuz.adapters.packagelocation import PackageLocation
 from lp.soyuz.enums import (
     ArchivePurpose,
@@ -68,8 +75,7 @@
         self.distroseries = distroseries
         self.parent = self.distroseries.parent_series
         self.arches = arches
-        self._store = getUtility(
-            IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR)
+        self._store = IMasterStore(DistroSeries)
 
     def check(self):
         if self.parent is None:

=== modified file 'lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py'
--- lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py	2010-08-30 06:38:53 +0000
+++ lib/lp/soyuz/scripts/tests/test_initialise_distroseries.py	2010-08-30 07:13:44 +0000
@@ -13,15 +13,15 @@
 from zope.component import getUtility
 
 from canonical.config import config
-from canonical.launchpad.ftests import login
 from canonical.launchpad.interfaces import IDistributionSet
-from canonical.launchpad.webapp.interfaces import (
-    IStoreSelector,
-    MAIN_STORE,
-    MASTER_FLAVOR,
-    )
+from canonical.launchpad.interfaces.lpstorm import IStore
 from canonical.testing.layers import LaunchpadZopelessLayer
+<<<<<<< TREE
 from lp.buildmaster.enums import BuildStatus
+=======
+
+from lp.buildmaster.interfaces.buildbase import BuildStatus
+>>>>>>> MERGE-SOURCE
 from lp.registry.interfaces.pocket import PackagePublishingPocket
 from lp.soyuz.interfaces.archivepermission import IArchivePermissionSet
 from lp.soyuz.interfaces.packageset import IPackagesetSet
@@ -31,7 +31,10 @@
     InitialisationError,
     InitialiseDistroSeries,
     )
-from lp.testing import TestCaseWithFactory
+from lp.testing import (
+    login,
+    TestCaseWithFactory,
+    )
 
 
 class TestInitialiseDistroSeries(TestCaseWithFactory):
@@ -150,8 +153,8 @@
         ids.check()
         ids.initialise()
         self.assertDistroSeriesInitialisedCorrectly(foobuntu)
-        store = getUtility(IStoreSelector).get(MAIN_STORE, MASTER_FLAVOR)
-        das = list(store.find(DistroArchSeries, distroseries = foobuntu))
+        das = list(IStore(DistroArchSeries).find(
+            DistroArchSeries, distroseries = foobuntu))
         self.assertEqual(len(das), 1)
         self.assertEqual(das[0].architecturetag, 'i386')