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:
parent
1e0b2f6629
commit
4114e25df1
1 changed files with 16 additions and 4 deletions
|
@ -40,10 +40,10 @@ class pmtest(object):
|
||||||
self.dbver = 9
|
self.dbver = 9
|
||||||
self.cachepkgs = True
|
self.cachepkgs = True
|
||||||
self.cmd = ["pacman", "--noconfirm",
|
self.cmd = ["pacman", "--noconfirm",
|
||||||
"--config", os.path.join(self.root, util.PACCONF),
|
"--config", self.configfile(),
|
||||||
"--root", self.root,
|
"--root", self.rootdir(),
|
||||||
"--dbpath", os.path.join(self.root, util.PM_DBPATH),
|
"--dbpath", self.dbdir(),
|
||||||
"--cachedir", os.path.join(self.root, util.PM_CACHEDIR)]
|
"--cachedir", self.cachedir()]
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "name = %s\n" \
|
return "name = %s\n" \
|
||||||
|
@ -294,4 +294,16 @@ class pmtest(object):
|
||||||
self.result["fail"] += 1
|
self.result["fail"] += 1
|
||||||
tap.ok(success, i)
|
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:
|
# vim: set ts=4 sw=4 et:
|
||||||
|
|
Loading…
Add table
Reference in a new issue