summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-10-23 02:53:44 -0400
committerAllan McRae <allan@archlinux.org>2014-11-04 20:11:18 +1000
commit4114e25df15a3f98bdd6f2d8e86996f1f8f04100 (patch)
treeb7e15e65a1c0bba182a27a67f9830f2f2852a217
parent1e0b2f6629f82c345b65693d607857c1c021aa6a (diff)
downloadpacman-4114e25df15a3f98bdd6f2d8e86996f1f8f04100.tar.xz
pmtest: make test paths easily available to tests
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--test/pacman/pmtest.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 5a79919e..49919718 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -40,10 +40,10 @@ class pmtest(object):
self.dbver = 9
self.cachepkgs = True
self.cmd = ["pacman", "--noconfirm",
- "--config", os.path.join(self.root, util.PACCONF),
- "--root", self.root,
- "--dbpath", os.path.join(self.root, util.PM_DBPATH),
- "--cachedir", os.path.join(self.root, util.PM_CACHEDIR)]
+ "--config", self.configfile(),
+ "--root", self.rootdir(),
+ "--dbpath", self.dbdir(),
+ "--cachedir", self.cachedir()]
def __str__(self):
return "name = %s\n" \
@@ -294,4 +294,16 @@ class pmtest(object):
self.result["fail"] += 1
tap.ok(success, i)
+ def configfile(self):
+ return os.path.join(self.root, util.PACCONF)
+
+ def dbdir(self):
+ return os.path.join(self.root, util.PM_DBPATH)
+
+ def rootdir(self):
+ return self.root + '/'
+
+ def cachedir(self):
+ return os.path.join(self.root, util.PM_CACHEDIR)
+
# vim: set ts=4 sw=4 et: