From 2d5ec02d7c82bdef1a9fb0565dcb67564968a8c0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 29 Jan 2011 11:25:56 -0600 Subject: pactest: allow checking for cache file existence This will allow some tests to be added for cache cleaning. Signed-off-by: Dan McGee --- test/pacman/pmrule.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/pacman/pmrule.py') diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index 62630457..c68d085e 100755 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -146,6 +146,13 @@ class pmrule(object): else: print "FILE rule '%s' not found" % case success = -1 + elif kind == "CACHE": + cachedir = os.path.join(test.root, util.PM_CACHEDIR) + if case == "EXISTS": + pkg = test.findpkg(key, value, allow_local=True) + if not pkg or not os.path.isfile( + os.path.join(cachedir, pkg.filename())): + success = 0 else: print "Rule kind '%s' not found" % kind success = -1 -- cgit v1.2.3-24-g4f1b