From a021109da0fb1e138adc912c44632f0956243769 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sun, 10 Sep 2006 12:02:11 +0200 Subject: * added new "MirrorsFile" keyword for the DistInfo Tagfile * look for mirros as well when matching distros --- tests/data/sources.list.testDistribution | 4 +++- tests/test_aptsources.py | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/data/sources.list.testDistribution b/tests/data/sources.list.testDistribution index 031e4c51..1687c504 100644 --- a/tests/data/sources.list.testDistribution +++ b/tests/data/sources.list.testDistribution @@ -6,4 +6,6 @@ deb http://de.archive.ubuntu.com/ubuntu/ edgy-updates restricted deb http://de.archive.ubuntu.com/ubuntu/ edgy-security main deb http://de.archive.ubuntu.com/ubuntu/ edgy-security multiverse deb http://ftp.debian.org/debian sid main -deb http://de.archive.ubuntu.com/ubuntu/ breezy main \ No newline at end of file +deb ftp://ubuntu.cs.utah.edu/pub/ubuntu/ubuntu/ breezy main +deb ftp://ubuntu.cs.utah.edu/pub/ubuntu/ubuntu/ breezy-backports main +deb http://archive.ubuntu.com/ubuntu/ hoary main diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 1db99e3c..3ee106be 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -81,6 +81,15 @@ class TestAptSources(unittest.TestCase): sources = aptsources.SourcesList() distro = aptsources.Distribution() distro.get_sources(sources) + # test if all suits of the current distro were detected correctly + dist_templates = set() + for s in sources: + if s.template: + dist_templates.add(s.template.name) + #print dist_templates + for d in ["edgy","edgy-security","edgy-updates","hoary","breezy", "breezy-backports"]: + self.assertTrue(d in dist_templates) + # test enable comp = "restricted" distro.enable_component(sources, comp) found = {} @@ -103,8 +112,8 @@ class TestAptSources(unittest.TestCase): found = {} for entry in sources: if (entry.type == "deb" and - entry.uri == "http://de.archive.ubuntu.com/ubuntu/" and - "edgy" in entry.dist): + entry.template and + entry.template.name == "edgy"): for c in entry.comps: if c == comp: if not found.has_key(entry.dist): -- cgit v1.2.3