summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-12-21 12:19:26 -0600
committerDan McGee <dan@archlinux.org>2010-12-21 14:58:17 -0600
commitfbcc42775492e5ba3df1b3235a23f23ad7faa241 (patch)
tree076897ce951214cd31ea37d6d217aeaf49beea49 /test
parentf2dff0860053f45c91e4ee301fda091a6b3d7361 (diff)
downloadpacman-fbcc42775492e5ba3df1b3235a23f23ad7faa241.tar.xz
pactest: allow testing of package description
And modify the code to not print the full rule string if it is more than 40 characters long; truncate it instead. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/pacman/pmrule.py10
-rwxr-xr-xtest/pacman/pmtest.py7
2 files changed, 7 insertions, 10 deletions
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py
index e7c9c44f..89ae3f49 100755
--- a/test/pacman/pmrule.py
+++ b/test/pacman/pmrule.py
@@ -29,7 +29,9 @@ class pmrule:
self.result = 0
def __str__(self):
- return "rule = %s" % self.rule
+ if len(self.rule) <= 40:
+ return self.rule
+ return self.rule[:37] + '...'
def check(self, root, retcode, localdb, files):
"""
@@ -76,6 +78,9 @@ class pmrule:
elif case == "VERSION":
if value != newpkg.version:
success = 0
+ elif case == "DESC":
+ if value != newpkg.desc:
+ success = 0
elif case == "GROUPS":
if not value in newpkg.groups:
success = 0
@@ -153,7 +158,4 @@ class pmrule:
self.result = success
return success
-
-if __name__ != "__main__":
- rule = pmrule("PKG_EXIST=dummy")
# vim: set ts=4 sw=4 et:
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index b7af5809..c70e41ae 100755
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -260,11 +260,6 @@ class pmtest:
self.result["fail"] += 1
else:
msg = "SKIP"
- print "\t[%s] %s" % (msg, i.rule)
- i.result = success
-
-
-if __name__ == "__main__":
- pass
+ print "\t[%s] %s" % (msg, i)
# vim: set ts=4 sw=4 et: