Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-29 12:10:05 -0600
committerDan McGee <dan@archlinux.org>2011-01-31 09:38:14 -0600
commit09f9f2433173477c0b0d269203e0f40df0907aa9 (patch)
treeeae68479fe1d80f20b84eb3c01a8def30aeee441 /test
parent986edb8bd4308b73ef225a554f13a07c232ead91 (diff)
Allow both cleanmethod values to be specified at the same time
No reason to disallow this- it allows keeping even more packages around in the cache. Test cases included for this case and to ensure the default behavior is preserved. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rw-r--r--test/pacman/tests/clean004.py30
-rw-r--r--test/pacman/tests/clean005.py29
2 files changed, 59 insertions, 0 deletions
diff --git a/test/pacman/tests/clean004.py b/test/pacman/tests/clean004.py
new file mode 100644
index 00000000..09137f39
--- /dev/null
+++ b/test/pacman/tests/clean004.py
@@ -0,0 +1,30 @@
+self.description = "CleanMethod = KeepInstalled KeepCurrent"
+
+sp = pmpkg("dummy", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("bar", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("baz", "2.0-1")
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("dummy", "1.0-1")
+self.addpkg2db("local", lp)
+
+lp = pmpkg("bar", "2.0-1")
+self.addpkg2db("local", lp)
+
+op = pmpkg("foo", "2.0-1")
+self.addpkg(op)
+
+self.args = "-Sc"
+self.option['CleanMethod'] = ['KeepInstalled KeepCurrent']
+self.createlocalpkgs = True
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("CACHE_EXISTS=dummy|2.0-1")
+self.addrule("CACHE_EXISTS=dummy|1.0-1")
+self.addrule("CACHE_EXISTS=bar|2.0-1")
+self.addrule("CACHE_EXISTS=baz|2.0-1")
+self.addrule("!CACHE_EXISTS=foo|2.0-1")
diff --git a/test/pacman/tests/clean005.py b/test/pacman/tests/clean005.py
new file mode 100644
index 00000000..f85248ef
--- /dev/null
+++ b/test/pacman/tests/clean005.py
@@ -0,0 +1,29 @@
+self.description = "CleanMethod = unspecified"
+
+sp = pmpkg("dummy", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("bar", "2.0-1")
+self.addpkg2db("sync", sp)
+
+sp = pmpkg("baz", "2.0-1")
+self.addpkg2db("sync", sp)
+
+lp = pmpkg("dummy", "1.0-1")
+self.addpkg2db("local", lp)
+
+lp = pmpkg("bar", "2.0-1")
+self.addpkg2db("local", lp)
+
+op = pmpkg("foo", "2.0-1")
+self.addpkg(op)
+
+self.args = "-Sc"
+self.createlocalpkgs = True
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!CACHE_EXISTS=dummy|2.0-1")
+self.addrule("CACHE_EXISTS=dummy|1.0-1")
+self.addrule("CACHE_EXISTS=bar|2.0-1")
+self.addrule("!CACHE_EXISTS=baz|2.0-1")
+self.addrule("!CACHE_EXISTS=foo|2.0-1")