diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-04 16:42:50 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-10-04 16:42:50 +0200 |
| commit | c24de9d51b0d3a5e8953dfc2b59aef85cafd34f1 (patch) | |
| tree | df97cd2d44ef44b7938d29ba3598bee7c637477a /tests | |
| parent | 822ebea49fadca39591a566ad5ef7559d3adc26d (diff) | |
| parent | a2363f7e30c93599af6366413bad965846a12d83 (diff) | |
| download | python-apt-c24de9d51b0d3a5e8953dfc2b59aef85cafd34f1.tar.gz | |
- packages in marked_install state can also be auto-removable
* add concept of "ParentComponent" for e.g. ubuntu/multiverse
that needs universe enabled as well (plus add test)
* apt/progress/gtk2.py:
- update to the latest vte API for child-exited (LP: #865388)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_all.py | 1 | ||||
| -rw-r--r-- | tests/test_aptsources.py | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_all.py b/tests/test_all.py index f7b9dc8c..0f548781 100644 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -43,6 +43,7 @@ if __name__ == '__main__': if dirname: os.chdir(dirname) library_dir = get_library_dir() + sys.stderr.write("Using library_dir: '%s'" % library_dir) if library_dir: sys.path.insert(0, os.path.abspath(library_dir)) diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index 193d3806..dcfb0682 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -160,6 +160,29 @@ class TestAptSources(unittest.TestCase): assert sources.list[8].comps == ["main"] assert sources.list[8].line.strip() == str(sources.list[8]) + def test_enable_component(self): + from subprocess import Popen, PIPE + target = "./data/aptsources/sources.list.enable_comps" + line = "deb http://archive.ubuntu.com/ubuntu lucid main\n" + open(target, "w").write(line) + apt_pkg.config.set("Dir::Etc::sourcelist", target) + sources = aptsources.sourceslist.SourcesList(True, self.templates) + distro = aptsources.distro.get_distro(id="Ubuntu") + # make sure we are using the right distro + distro.codename = "lucid" + distro.id = "Ubuntu" + distro.release = "10.04" + # and get the sources + distro.get_sources(sources) + # test enable_component + comp = "multiverse" + distro.enable_component(comp) + comps = set() + for entry in sources: + comps = comps.union(set(entry.comps)) + self.assertTrue("multiverse" in comps) + self.assertTrue("universe" in comps) + def testDistribution(self): """aptsources: Test distribution detection.""" apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" |
