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>
This commit is contained in:
Andrew Gregory 2014-10-23 02:53:44 -04:00 committed by Allan McRae
parent 1e0b2f6629
commit 4114e25df1
1 changed files with 16 additions and 4 deletions

View File

@ -40,10 +40,10 @@ def __init__(self, name, root):
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 @@ def check(self):
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: