summaryrefslogtreecommitdiff
path: root/tests/test_aptsources.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2011-04-06 10:09:19 +0200
committerJulian Andres Klode <jak@debian.org>2011-04-06 10:09:19 +0200
commit82bd14484ffa3fbe0b68777402cb31000bd7dd22 (patch)
tree70da06b97b1827a86883ef5e1d87842ebb23b1e9 /tests/test_aptsources.py
parentef797f74a1948be2231a28786d2c40d047f9c49d (diff)
downloadpython-apt-82bd14484ffa3fbe0b68777402cb31000bd7dd22.tar.gz
aptsources: Parse multi-arch sources.list files correctly
Diffstat (limited to 'tests/test_aptsources.py')
-rw-r--r--tests/test_aptsources.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py
index 331df935..aeb2ce31 100644
--- a/tests/test_aptsources.py
+++ b/tests/test_aptsources.py
@@ -39,11 +39,11 @@ class TestAptSources(unittest.TestCase):
apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/"
"sources.list")
sources = aptsources.sourceslist.SourcesList(True, self.templates)
- self.assertEqual(len(sources.list), 6)
+ self.assertEqual(len(sources.list), 9)
# test load
sources.list = []
sources.load("data/aptsources/sources.list")
- self.assertEqual(len(sources.list), 6)
+ self.assertEqual(len(sources.list), 9)
def testSourcesListAdding(self):
"""aptsources: Test additions to sources.list"""
@@ -108,6 +108,21 @@ class TestAptSources(unittest.TestCase):
if not s.template:
self.fail("source entry '%s' has no matcher" % s)
+ def testMultiArch(self):
+ """aptsources: Test multi-arch parsing"""
+
+ apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/"
+ "sources.list")
+ sources = aptsources.sourceslist.SourcesList(True, self.templates)
+
+ assert sources.list[8].invalid == False
+ assert sources.list[8].type == "deb"
+ assert sources.list[8].architectures == ["amd64", "i386"]
+ assert sources.list[8].uri == "http://de.archive.ubuntu.com/ubuntu/"
+ assert sources.list[8].dist == "natty"
+ assert sources.list[8].comps == ["main"]
+ assert sources.list[8].line.strip() == str(sources.list[8])
+
def testDistribution(self):
"""aptsources: Test distribution detection."""
apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/"