1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-15 13:55:09 -05:00
pacman/test/pacman/tests/smoke001.py
Jeremy Heiner e9c7c3b90d Use Python's "range" instead of deprecated "xrange".
Reported by 2to3. Python 3 throws out the old range, renames the old
xrange to be the new range, leaving no xrange. A shim could be used,
but using the less efficient version does not have a noticeable impact
on the run time.  This observed (lack of an) effect is as described in
the Python 2 docs for xrange. The largest range created is only 1000
elements big, and the memory cost of those ranges is negligible when
compared to that of all the pmpkg instances created.

Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-10-14 13:01:15 +10:00

23 lines
620 B
Python

self.description = "Install a thousand packages in a single transaction"
p = pmpkg("pkg1000")
self.addpkg2db("local", p)
for i in range(1000):
p = pmpkg("pkg%03d" % i)
p.depends = ["pkg%03d" % (i+1)]
p.files = ["usr/share/pkg%03d" % i]
self.addpkg(p)
pkglist = [p.filename() for p in self.localpkgs]
self.args = "-U %s" % " ".join(pkglist)
self.addrule("PACMAN_RETCODE=0")
#for i in range(1000):
# self.addrule("PKG_EXIST=pkg%03d" %i)
# picked 3 random packages to test for, since the loop is too much to handle
self.addrule("PKG_EXIST=pkg050")
self.addrule("PKG_EXIST=pkg674")
self.addrule("PKG_EXIST=pkg999")