Exemple #1
0
 def test_build_menu_primary(self):
     # The menu presented in the build page depends on the targeted
     # archive. For instance the 'PPA' action-menu link is not enabled
     # for builds targeted to the PRIMARY archive.
     archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
     removeSecurityProxy(archive).require_virtualized = False
     build = self.factory.makeBinaryPackageBuild(archive=archive)
     build_menu = BuildContextMenu(build)
     self.assertEqual(build_menu.links,
                      ['ppa', 'records', 'retry', 'rescore', 'cancel'])
     self.assertFalse(build_menu.is_ppa_build)
     self.assertFalse(build_menu.ppa().enabled)
     # Cancel is not enabled on non-virtual builds.
     self.assertFalse(build_menu.cancel().enabled)
 def test_build_menu_primary(self):
     # The menu presented in the build page depends on the targeted
     # archive. For instance the 'PPA' action-menu link is not enabled
     # for builds targeted to the PRIMARY archive.
     archive = self.factory.makeArchive(purpose=ArchivePurpose.PRIMARY)
     removeSecurityProxy(archive).require_virtualized = False
     build = self.factory.makeBinaryPackageBuild(archive=archive)
     build_menu = BuildContextMenu(build)
     self.assertEquals(
         build_menu.links,
         ['ppa', 'records', 'retry', 'rescore', 'cancel'])
     self.assertFalse(build_menu.is_ppa_build)
     self.assertFalse(build_menu.ppa().enabled)
     # Cancel is not enabled on non-virtual builds.
     self.assertFalse(build_menu.cancel().enabled)
Exemple #3
0
 def test_build_menu_ppa(self):
     # The 'PPA' action-menu item will be enabled if we target the build
     # to a PPA.
     ppa = self.factory.makeArchive(purpose=ArchivePurpose.PPA,
                                    virtualized=True)
     build = self.factory.makeBinaryPackageBuild(archive=ppa)
     build.queueBuild()
     build_menu = BuildContextMenu(build)
     self.assertEqual(build_menu.links,
                      ['ppa', 'records', 'retry', 'rescore', 'cancel'])
     self.assertTrue(build_menu.is_ppa_build)
     self.assertTrue(build_menu.ppa().enabled)
     # Cancel is enabled on virtual builds if the user is in the
     # owning archive's team.
     with person_logged_in(ppa.owner):
         self.assertTrue(build_menu.cancel().enabled)
 def test_build_menu_ppa(self):
     # The 'PPA' action-menu item will be enabled if we target the build
     # to a PPA.
     ppa = self.factory.makeArchive(
         purpose=ArchivePurpose.PPA, virtualized=True)
     build = self.factory.makeBinaryPackageBuild(archive=ppa)
     build.queueBuild()
     build_menu = BuildContextMenu(build)
     self.assertEquals(
         build_menu.links,
         ['ppa', 'records', 'retry', 'rescore', 'cancel'])
     self.assertTrue(build_menu.is_ppa_build)
     self.assertTrue(build_menu.ppa().enabled)
     # Cancel is enabled on virtual builds if the user is in the
     # owning archive's team.
     with person_logged_in(ppa.owner):
         self.assertTrue(build_menu.cancel().enabled)