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-11 21:20:10 -0600
committerDan McGee <dan@archlinux.org>2011-01-11 21:20:10 -0600
commit57c5afd69c4c70ad85676bab32150d6182a3def9 (patch)
treed0205a02cf32351441f32c37a954890e1a76b6dc /test
parent0284cf2128eb0179a3598ee21a951c5b3c11be40 (diff)
parent33240e87b99e5aebd0e64a672ea307a698edb32f (diff)
Merge branch 'fix-double-load'
Diffstat (limited to 'test')
-rwxr-xr-xtest/pacman/pmdb.py10
-rw-r--r--test/pacman/tests/remove002.py12
-rw-r--r--test/pacman/tests/upgrade006.py18
3 files changed, 34 insertions, 6 deletions
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index 60460ce2..b4d0e2d5 100755
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -38,16 +38,14 @@ def _mkfilelist(files):
usr/local/bin/
usr/local/bin/dummy
"""
- i = []
+ file_list = set()
for f in files:
dir = getfilename(f)
- i.append(dir)
+ file_list.add(dir)
while "/" in dir:
[dir, tmp] = dir.rsplit("/", 1)
- if not dir + "/" in files:
- i.append(dir + "/")
- i.sort()
- return i
+ file_list.add(dir + "/")
+ return sorted(file_list)
def _mkbackuplist(backup):
"""
diff --git a/test/pacman/tests/remove002.py b/test/pacman/tests/remove002.py
new file mode 100644
index 00000000..1deffb0d
--- /dev/null
+++ b/test/pacman/tests/remove002.py
@@ -0,0 +1,12 @@
+self.description = "Remove a package with several files"
+
+p = pmpkg("foo")
+p.files = ["usr/share/file_%d" % n for n in range(1000)]
+self.addpkg2db("local", p)
+
+self.args = "-R %s" % p.name
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("!PKG_EXIST=foo")
+self.addrule("!FILE_EXIST=usr/share/file_0")
+self.addrule("!FILE_EXIST=usr/share/file_999")
diff --git a/test/pacman/tests/upgrade006.py b/test/pacman/tests/upgrade006.py
new file mode 100644
index 00000000..5e5173b5
--- /dev/null
+++ b/test/pacman/tests/upgrade006.py
@@ -0,0 +1,18 @@
+self.description = "Upgrade a package with several files"
+
+lp = pmpkg("dummy")
+lp.files = ["usr/share/file_%d" % n for n in range(250, 750)]
+self.addpkg2db("local", lp)
+
+p = pmpkg("dummy", "1.1-1")
+p.files = ["usr/share/file_%d" % n for n in range(600, 1000)]
+self.addpkg(p)
+
+self.args = "-U %s" % p.filename()
+
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=dummy|1.1-1")
+self.addrule("!FILE_EXIST=usr/share/file_250")
+self.addrule("!FILE_EXIST=usr/share/file_599")
+self.addrule("FILE_EXIST=usr/share/file_600")
+self.addrule("FILE_EXIST=usr/share/file_999")