summaryrefslogtreecommitdiff
path: root/tests/test_aptsources.py
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-04-06 16:57:01 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-04-06 16:57:01 +0200
commit6f4cc51023476625d97ed657073b948e8390fa01 (patch)
treee41d5a16638de2d1cfa56fb75b0ca9435d62d7ec /tests/test_aptsources.py
parent2d07b3bb94bed958e1fce5225e5723de07054039 (diff)
downloadpython-apt-6f4cc51023476625d97ed657073b948e8390fa01.tar.gz
cherry pick -r 504..505 http://bzr.debian.org/apt/python-apt/debian-experimental
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/"