[pacman-dev] [PATCH 2/4] pmtest: make test paths easily available to tests

Andrew Gregory andrew.gregory.8 at gmail.com
Thu Oct 23 07:42:25 UTC 2014


Signed-off-by: Andrew Gregory <andrew.gregory.8 at gmail.com>
---
 test/pacman/pmtest.py | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index 5a79919..4991971 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -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:
-- 
2.1.2


More information about the pacman-dev mailing list