From cbd822c9dfe8cf18d828bd558290f15775b4d837 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 17 Jul 2009 19:40:47 +0200 Subject: tests: First work on the new testsuite. The module tests.test_all will run all available tests. Each test placed herein must be using unittest and provide at least 1 test case. It must be prefixed with test_. --- tests/old/pkgsrcrecords.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/old/pkgsrcrecords.py (limited to 'tests/old/pkgsrcrecords.py') diff --git a/tests/old/pkgsrcrecords.py b/tests/old/pkgsrcrecords.py new file mode 100644 index 00000000..2ea9dd3a --- /dev/null +++ b/tests/old/pkgsrcrecords.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python2.4 +# +# Test for the PkgSrcRecords code +# it segfaults for python-apt < 0.5.37 +# + +import apt_pkg +import sys + + +def main(): + apt_pkg.init() + cache = apt_pkg.Cache() + i=0 + print "Running PkgSrcRecords test on all packages:" + for x in cache.Packages: + i += 1 + src = apt_pkg.SourceRecords() + if src.Lookup(x.Name): + #print src.Package + pass + print "\r%i/%i=%.3f%% " % ( + i, cache.PackageCount, + (float(i) / float(cache.PackageCount) * 100)), + + +if __name__ == "__main__": + main() + sys.exit(0) -- cgit v1.2.3