← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/git-feature-flag into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/git-feature-flag into lp:launchpad.

Commit message:
Set the code.git.enabled feature flag for TestGitRepositoryView* and TestPersonNavigation.test_traverse_git_repository_* tests.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #1032731 in Launchpad itself: "Support for Launchpad-hosted Git repositories"
  https://bugs.launchpad.net/launchpad/+bug/1032731

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/git-feature-flag/+merge/251965

Set the code.git.enabled feature flag for TestGitRepositoryView* and TestPersonNavigation.test_traverse_git_repository_* tests.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/git-feature-flag into lp:launchpad.
=== modified file 'lib/lp/code/browser/tests/test_gitrepository.py'
--- lib/lp/code/browser/tests/test_gitrepository.py	2015-03-04 16:49:42 +0000
+++ lib/lp/code/browser/tests/test_gitrepository.py	2015-03-05 15:29:12 +0000
@@ -13,8 +13,10 @@
 
 from lp.app.enums import InformationType
 from lp.app.interfaces.services import IService
+from lp.code.interfaces.gitrepository import GIT_FEATURE_FLAG
 from lp.registry.interfaces.person import PersonVisibility
 from lp.services.config import config
+from lp.services.features.testing import FeatureFixture
 from lp.services.webapp.publisher import canonical_url
 from lp.testing import (
     admin_logged_in,
@@ -35,6 +37,10 @@
 
     layer = DatabaseFunctionalLayer
 
+    def setUp(self):
+        super(TestGitRepositoryView, self).setUp()
+        self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
+
     def test_anon_url_for_public(self):
         # Public repositories have an anonymous URL, visible to anyone.
         repository = self.factory.makeGitRepository()
@@ -133,6 +139,10 @@
 
     layer = DatabaseFunctionalLayer
 
+    def setUp(self):
+        super(TestGitRepositoryViewPrivateArtifacts, self).setUp()
+        self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
+
     def _getBrowser(self, user=None):
         if user is None:
             browser = setupBrowser()

=== modified file 'lib/lp/registry/browser/tests/test_person.py'
--- lib/lp/registry/browser/tests/test_person.py	2015-03-04 16:57:42 +0000
+++ lib/lp/registry/browser/tests/test_person.py	2015-03-05 15:29:12 +0000
@@ -27,6 +27,7 @@
 from lp.app.interfaces.launchpad import ILaunchpadCelebrities
 from lp.blueprints.enums import SpecificationImplementationStatus
 from lp.buildmaster.enums import BuildStatus
+from lp.code.interfaces.gitrepository import GIT_FEATURE_FLAG
 from lp.registry.browser.person import PersonView
 from lp.registry.browser.team import TeamInvitationView
 from lp.registry.enums import PersonVisibility
@@ -41,6 +42,7 @@
 from lp.registry.model.milestone import milestone_sort_key
 from lp.scripts.garbo import PopulateLatestPersonSourcePackageReleaseCache
 from lp.services.config import config
+from lp.services.features.testing import FeatureFixture
 from lp.services.identity.interfaces.account import AccountStatus
 from lp.services.identity.interfaces.emailaddress import IEmailAddressSet
 from lp.services.log.logger import FakeLogger
@@ -145,6 +147,7 @@
         self.assertRedirect('/api/1.0' + in_suf, '/api/1.0' + out_suf)
 
     def test_traverse_git_repository_project(self):
+        self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
         project = self.factory.makeProduct()
         repository = self.factory.makeGitRepository(target=project)
         url = "/~%s/%s/+git/%s" % (
@@ -152,6 +155,7 @@
         self.assertEqual(repository, test_traverse(url)[0])
 
     def test_traverse_git_repository_package(self):
+        self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
         dsp = self.factory.makeDistributionSourcePackage()
         repository = self.factory.makeGitRepository(target=dsp)
         url = "/~%s/%s/+source/%s/+git/%s" % (
@@ -160,6 +164,7 @@
         self.assertEqual(repository, test_traverse(url)[0])
 
     def test_traverse_git_repository_personal(self):
+        self.useFixture(FeatureFixture({GIT_FEATURE_FLAG: u"on"}))
         person = self.factory.makePerson()
         repository = self.factory.makeGitRepository(
             owner=person, target=person)


Follow ups