diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-04-06 16:57:01 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-04-06 16:57:01 +0200 |
| commit | 6f4cc51023476625d97ed657073b948e8390fa01 (patch) | |
| tree | e41d5a16638de2d1cfa56fb75b0ca9435d62d7ec /tests | |
| parent | 2d07b3bb94bed958e1fce5225e5723de07054039 (diff) | |
| download | python-apt-6f4cc51023476625d97ed657073b948e8390fa01.tar.gz | |
cherry pick -r 504..505 http://bzr.debian.org/apt/python-apt/debian-experimental
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/data/aptsources/sources.list | 5 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 19 |
2 files changed, 21 insertions, 3 deletions
diff --git a/tests/data/aptsources/sources.list b/tests/data/aptsources/sources.list index 5481d4f0..376d6961 100644 --- a/tests/data/aptsources/sources.list +++ b/tests/data/aptsources/sources.list @@ -3,4 +3,7 @@ deb http://de.archive.ubuntu.com/ubuntu/ edgy main # comment 2 deb http://de.archive.ubuntu.com/ubuntu/ edgy restricted # comment 3 -deb http://de.archive.ubuntu.com/ubuntu/ edgy universe
\ No newline at end of file +deb http://de.archive.ubuntu.com/ubuntu/ edgy universe + +# multi-arch +deb [arch=amd64,i386] http://de.archive.ubuntu.com/ubuntu/ natty main 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/" |
