summaryrefslogtreecommitdiff
path: root/tests/test_aptsources.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_aptsources.py')
-rw-r--r--tests/test_aptsources.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_aptsources.py b/tests/test_aptsources.py
index aeb2ce31..1597674e 100644
--- a/tests/test_aptsources.py
+++ b/tests/test_aptsources.py
@@ -62,6 +62,14 @@ class TestAptSources(unittest.TestCase):
"edgy",
["restricted"])
self.assertTrue(sources.list == before.list)
+
+ before = copy.deepcopy(sources)
+ sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/",
+ "natty",
+ ["main"], architectures=["amd64", "i386"])
+ self.assertTrue(sources.list == before.list)
+
+
# test to add something new: multiverse
sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/",
"edgy",
@@ -74,6 +82,34 @@ class TestAptSources(unittest.TestCase):
"multiverse" in entry.comps):
found = True
self.assertTrue(found)
+
+ # add a new natty entry without architecture specification
+ sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/",
+ "natty",
+ ["multiverse"])
+ found = False
+ for entry in sources:
+ if (entry.type == "deb" and
+ entry.uri == "http://de.archive.ubuntu.com/ubuntu/" and
+ entry.dist == "natty" and
+ entry.architectures == [] and
+ "multiverse" in entry.comps):
+ found = True
+ self.assertTrue(found)
+
+ # Add universe to existing multi-arch line
+ sources.add("deb", "http://de.archive.ubuntu.com/ubuntu/",
+ "natty",
+ ["universe"], architectures=["i386", "amd64"])
+ found = False
+ for entry in sources:
+ if (entry.type == "deb" and
+ entry.uri == "http://de.archive.ubuntu.com/ubuntu/" and
+ entry.dist == "natty" and
+ set(entry.architectures) == set(["amd64", "i386"]) and
+ set(entry.comps) == set(["main", "universe"])):
+ found = True
+ self.assertTrue(found)
# test to add something new: multiverse *and*
# something that is already there
before = copy.deepcopy(sources)