Exemple #1
0
    def testArchAll(self):
        pl = PackageList(source_all)

        self.assertTrue(pl.has_arch_indep_packages())
        self.assertFalse(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 0)

        suite_all = FakeSuite('all')
        p_all = pl.packages_for_suite(suite_all)
        self.assertEqual(len(p_all), 1)

        suite_all_amd64 = FakeSuite('amd64', 'all')
        p_all_amd64 = pl.packages_for_suite(suite_all_amd64)
        self.assertEqual(len(p_all_amd64), 1)

        p = p_all[0]
        self.assertEqual(p.name, 'libdune-common-doc')
        self.assertEqual(p.type, 'deb')
        self.assertEqual(p.section, 'doc')
        self.assertEqual(p.component, 'main')
        self.assertEqual(p.priority, 'optional')
        self.assertEqual(p.architectures, ['all'])
    def testArchAll(self):
        pl = PackageList(source_all)

        self.assertTrue(pl.has_arch_indep_packages())
        self.assertFalse(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 0)

        suite_all = FakeSuite('all')
        p_all = pl.packages_for_suite(suite_all)
        self.assertEqual(len(p_all), 1)

        suite_all_amd64 = FakeSuite('amd64', 'all')
        p_all_amd64 = pl.packages_for_suite(suite_all_amd64)
        self.assertEqual(len(p_all_amd64), 1)

        p = p_all[0]
        self.assertEqual(p.name, 'libdune-common-doc')
        self.assertEqual(p.type, 'deb')
        self.assertEqual(p.section, 'doc')
        self.assertEqual(p.component, 'main')
        self.assertEqual(p.priority, 'optional')
        self.assertEqual(p.architectures, ['all'])
Exemple #3
0
    def testArchAmd64(self):
        pl = PackageList(source_amd64)

        self.assertFalse(pl.has_arch_indep_packages())
        self.assertTrue(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)

        suite_i386 = FakeSuite('i386')
        p_i386 = pl.packages_for_suite(suite_i386)
        self.assertEqual(len(p_i386), 0)
    def testArchAmd64(self):
        pl = PackageList(source_amd64)

        self.assertFalse(pl.has_arch_indep_packages())
        self.assertTrue(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)

        suite_i386 = FakeSuite('i386')
        p_i386 = pl.packages_for_suite(suite_i386)
        self.assertEqual(len(p_i386), 0)
Exemple #5
0
    def testArchAny(self):
        pl = PackageList(source_any)

        self.assertFalse(pl.has_arch_indep_packages())
        self.assertTrue(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)

        suite_all = FakeSuite('all')
        p_all = pl.packages_for_suite(suite_all)
        self.assertEqual(len(p_all), 0)

        suite_all_amd64 = FakeSuite('amd64', 'all')
        p_all_amd64 = pl.packages_for_suite(suite_all_amd64)
        self.assertEqual(len(p_all_amd64), 1)
    def testArchAny(self):
        pl = PackageList(source_any)

        self.assertFalse(pl.has_arch_indep_packages())
        self.assertTrue(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)

        suite_all = FakeSuite('all')
        p_all = pl.packages_for_suite(suite_all)
        self.assertEqual(len(p_all), 0)

        suite_all_amd64 = FakeSuite('amd64', 'all')
        p_all_amd64 = pl.packages_for_suite(suite_all_amd64)
        self.assertEqual(len(p_all_amd64), 1)
Exemple #7
0
    def testFallback(self):
        pl = PackageList(source_fallback)

        self.assertIsNone(pl.has_arch_indep_packages())
        self.assertIsNone(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)
    def testFallback(self):
        pl = PackageList(source_fallback)

        self.assertIsNone(pl.has_arch_indep_packages())
        self.assertIsNone(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)
Exemple #9
0
    def testProfiles(self):
        pl = PackageList(source_profiles)

        self.assertEqual(len(pl.package_list), 8)

        built_in_default_profile = {'pkg-a', 'pkg-b', 'pkg-f', 'pkg-g', 'pkg-h'}
        not_built_in_default_profile = {'pkg-c', 'pkg-d', 'pkg-e'}

        for entry in pl.package_list:
            if entry.built_in_default_profile():
                self.assertIn(entry.name, built_in_default_profile)
            else:
                self.assertIn(entry.name, not_built_in_default_profile)

        suite_amd64 = FakeSuite('amd64')
        ps_only_default = pl.packages_for_suite(suite_amd64)
        ps_all = pl.packages_for_suite(suite_amd64, only_default_profile=False)
        self.assertSetEqual({p.name for p in ps_only_default}, built_in_default_profile)
        self.assertSetEqual({p.name for p in ps_all}, built_in_default_profile | not_built_in_default_profile)
Exemple #10
0
    def testArchLinuxAny(self):
        pl = PackageList(source_linuxany)

        self.assertFalse(pl.has_arch_indep_packages())
        self.assertTrue(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)

        suite_i386 = FakeSuite('i386')
        p_i386 = pl.packages_for_suite(suite_i386)
        self.assertEqual(len(p_i386), 1)

        suite_kfreebsdi386 = FakeSuite('kfreebsd-i386')
        p_kfreebsdi386 = pl.packages_for_suite(suite_kfreebsdi386)
        self.assertEqual(len(p_kfreebsdi386), 0)

        suite_source = FakeSuite('source')
        p_source = pl.packages_for_suite(suite_source)
        self.assertEqual(len(p_source), 0)
    def testArchLinuxAny(self):
        pl = PackageList(source_linuxany)

        self.assertFalse(pl.has_arch_indep_packages())
        self.assertTrue(pl.has_arch_dep_packages())

        suite_amd64 = FakeSuite('amd64')
        p_amd64 = pl.packages_for_suite(suite_amd64)
        self.assertEqual(len(p_amd64), 1)

        suite_i386 = FakeSuite('i386')
        p_i386 = pl.packages_for_suite(suite_i386)
        self.assertEqual(len(p_i386), 1)

        suite_kfreebsdi386 = FakeSuite('kfreebsd-i386')
        p_kfreebsdi386 = pl.packages_for_suite(suite_kfreebsdi386)
        self.assertEqual(len(p_kfreebsdi386), 0)

        suite_source = FakeSuite('source')
        p_source = pl.packages_for_suite(suite_source)
        self.assertEqual(len(p_source), 0)