From 4114e25df15a3f98bdd6f2d8e86996f1f8f04100 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Thu, 23 Oct 2014 02:53:44 -0400 Subject: pmtest: make test paths easily available to tests Signed-off-by: Andrew Gregory Signed-off-by: Allan McRae --- test/pacman/pmtest.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'test') 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: -- cgit v1.2.3-70-g09d2