From d44831bb1d10ac1bc29690fd226209fb71b91b42 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 18 Sep 2008 14:35:14 +0200 Subject: * python/apt_pkgmodule.cc: add "SelState{Unknown,Install,Hold,DeInstall,Purge}" constants - fix detection of cdrom sources and add test for it --- tests/data/sources.list.testDistribution | 2 ++ tests/test_aptsources.py | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/data/sources.list.testDistribution b/tests/data/sources.list.testDistribution index 45c155e9..0f40e85a 100644 --- a/tests/data/sources.list.testDistribution +++ b/tests/data/sources.list.testDistribution @@ -9,3 +9,5 @@ deb http://ftp.debian.org/debian sid main deb http://ubuntu.cs.uaf.edu/ubuntu/ hardy main deb http://ubuntu.cs.uaf.edu/ubuntu/ hardy-backports main deb http://archive.ubuntu.com/ubuntu/ intrepid main +deb cdrom:[Ubuntu 8.10 _Intrepid Ibex_ - Alpha]/ intrepid main +deb cdrom:[Ubuntu 8.04 _Hardy Heron_] hardy main \ No newline at end of file diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 4b2c7965..49fe6afa 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -83,6 +83,14 @@ class TestAptSources(unittest.TestCase): def testMatcher(self): apt_pkg.Config.Set("Dir::Etc::sourcelist","data/sources.list.testDistribution") + sources = aptsources.sourceslist.SourcesList() + distro = aptsources.distro.get_distro() + distro.get_sources(sources) + # test if all suits of the current distro were detected correctly + dist_templates = set() + for s in sources: + if not s.template: + self.fail("source entry '%s' has no matcher" % s) def testDistribution(self): apt_pkg.Config.Set("Dir::Etc::sourcelist","data/sources.list.testDistribution") -- cgit v1.2.3