diff options
| author | sampo555 <sampo_75@windowslive.com> | 2012-08-31 22:00:36 +0300 |
|---|---|---|
| committer | sampo555 <sampo_75@windowslive.com> | 2012-08-31 22:00:36 +0300 |
| commit | 58ec5e4ea6c4e07a62611d0b588638688c42899b (patch) | |
| tree | d7f0c67560f3ebdbeebbcf287ae726f7f471b24c /tests | |
| parent | a8290b2bd58aa4a75eeab34145daa4079b450533 (diff) | |
| download | python-apt-58ec5e4ea6c4e07a62611d0b588638688c42899b.tar.gz | |
Enable disabled repository instead of adding a new entry if a duplicate disabled entry already exists (LP: #1042916).
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_aptsources.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py index dcfb0682..41cfabb3 100644 --- a/tests/test_aptsources.py +++ b/tests/test_aptsources.py @@ -233,6 +233,20 @@ class TestAptSources(unittest.TestCase): for key in found: self.assertEqual(found[key], 1) + def test_enable_disabled(self): + """LP: #1042916: Test enabling disabled entry.""" + apt_pkg.config.set("Dir::Etc::sourcelist", "data/aptsources/" + "sources.list") + sources = aptsources.sourceslist.SourcesList(True, self.templates) + disabled = sources.add("deb", "http://fi.archive.ubuntu.com/ubuntu/", + "precise", + ["main"]) + disabled.set_enabled(False) + enabled = sources.add("deb", "http://fi.archive.ubuntu.com/ubuntu/", + "precise", + ["main"]) + self.assertEqual(disabled, enabled) + self.assertFalse(disabled.disabled) if __name__ == "__main__": os.chdir(os.path.dirname(__file__)) |
