~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/tests/test_archive.py

[r=gmb][bug=837975] Add two fields to distro's +add and +edit pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
981
981
 
982
982
    def test_main_archive_can_use_restricted(self):
983
983
        # Main archives for distributions can always use restricted
984
 
        # architectures.
 
984
        # architectures if they are not using virtual builders.
985
985
        distro = self.factory.makeDistribution()
 
986
        distro.main_archive.require_virtualized = False
986
987
        self.assertContentEqual([self.arm],
987
988
            distro.main_archive.enabled_restricted_families)
988
989
 
989
 
    def test_main_archive_can_not_be_restricted(self):
990
 
        # A main archive can not be restricted to certain architectures.
 
990
    def test_main_archive_can_not_be_restricted_not_virtualized(self):
 
991
        # A main archive can not be restricted to certain architectures
 
992
        # (unless it's set to build on virtualized builders).
991
993
        distro = self.factory.makeDistribution()
 
994
        distro.main_archive.require_virtualized = False
992
995
        # Restricting to all restricted architectures is fine
993
996
        distro.main_archive.enabled_restricted_families = [self.arm]
994
997
 
997
1000
 
998
1001
        self.assertRaises(CannotRestrictArchitectures, restrict)
999
1002
 
 
1003
    def test_main_virtualized_archive_can_be_restricted(self):
 
1004
        # A main archive can be restricted to certain architectures
 
1005
        # if it's set to build on virtualized builders.
 
1006
        distro = self.factory.makeDistribution()
 
1007
        distro.main_archive.require_virtualized = True
 
1008
 
 
1009
        # Restricting to architectures is fine.
 
1010
        distro.main_archive.enabled_restricted_families = [self.arm]
 
1011
        distro.main_archive.enabled_restricted_families = []
 
1012
 
1000
1013
    def test_default(self):
1001
1014
        """By default, ARM builds are not allowed as ARM is restricted."""
1002
1015
        self.assertEquals(0,