diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-17 19:40:47 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-17 19:40:47 +0200 |
| commit | cbd822c9dfe8cf18d828bd558290f15775b4d837 (patch) | |
| tree | b9ee1d702dd85a5dc2cbd9303e7f31ca6b8ffa52 /tests/cache.py | |
| parent | 9bd7c1dcf9942d6ce294aa5ac58d90d6c1aa9f51 (diff) | |
| download | python-apt-cbd822c9dfe8cf18d828bd558290f15775b4d837.tar.gz | |
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_.
Diffstat (limited to 'tests/cache.py')
| -rw-r--r-- | tests/cache.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/tests/cache.py b/tests/cache.py deleted file mode 100644 index f0bf6761..00000000 --- a/tests/cache.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/python -# -# Test for the pkgCache code -# - -import apt_pkg -import sys - - -def main(): - apt_pkg.init() - cache = apt_pkg.Cache() - depcache = apt_pkg.DepCache(cache) - depcache.Init() - i=0 - all=cache.PackageCount - print "Running Cache test on all packages:" - # first, get all pkgs - for pkg in cache.Packages: - i += 1 - x = pkg.Name - # then get each version - for ver in pkg.VersionList: - # get some version information - a = ver.FileList - b = ver.VerStr - c = ver.Arch - d = ver.DependsListStr - dl = ver.DependsList - # get all dependencies (a dict of string->list, - # e.g. "depends:" -> [ver1,ver2,..] - for dep in dl.keys(): - # get the list of each dependency object - for depVerList in dl[dep]: - for z in depVerList: - # get all TargetVersions of - # the dependency object - for j in z.AllTargets(): - f = j.FileList - g = ver.VerStr - h = ver.Arch - k = ver.DependsListStr - j = ver.DependsList - pass - - print "\r%i/%i=%.3f%% " % (i, all, (float(i) / float(all) * 100)), - - -if __name__ == "__main__": - main() - sys.exit(0) |
