summaryrefslogtreecommitdiff
path: root/tests/old/depcache.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2013-10-21 20:43:18 +0200
committerJulian Andres Klode <jak@debian.org>2013-10-21 20:43:18 +0200
commit247bdb9c62efb2f7d68c71a18e84addda3aec7bc (patch)
tree39acb4b0187a02a059402a1c0153c03aab79f28b /tests/old/depcache.py
parent9b2e18e4d1b95ef505f87561ac06aba50ada3609 (diff)
downloadpython-apt-247bdb9c62efb2f7d68c71a18e84addda3aec7bc.tar.gz
tests/old/*.py: Update to new API as well
Diffstat (limited to 'tests/old/depcache.py')
-rw-r--r--tests/old/depcache.py46
1 files changed, 23 insertions, 23 deletions
diff --git a/tests/old/depcache.py b/tests/old/depcache.py
index 0d59648e..cc030ed0 100644
--- a/tests/old/depcache.py
+++ b/tests/old/depcache.py
@@ -11,42 +11,42 @@ def main():
apt_pkg.init()
cache = apt_pkg.Cache()
depcache = apt_pkg.DepCache(cache)
- depcache.Init()
+ depcache.init()
i=0
- all=cache.PackageCount
+ all=cache.package_count
print "Running DepCache test on all packages"
print "(trying to install each and then mark it keep again):"
# first, get all pkgs
- for pkg in cache.Packages:
+ for pkg in cache.packages:
i += 1
- x = pkg.Name
+ x = pkg.name
# then get each version
- ver =depcache.GetCandidateVer(pkg)
+ ver =depcache.get_candidate_ver(pkg)
if ver is not None:
- depcache.MarkInstall(pkg)
- if depcache.InstCount == 0:
- if depcache.IsUpgradable(pkg):
+ depcache.mark_install(pkg)
+ if depcache.inst_count == 0:
+ if depcache.is_upgradable(pkg):
print "Error marking %s for install" % x
- for p in cache.Packages:
- if depcache.MarkedInstall(p):
- depcache.MarkKeep(p)
- if depcache.InstCount != 0:
- print "Error undoing the selection for %s (InstCount: %s)" % (
- x, depcache.InstCount)
+ for p in cache.packages:
+ if depcache.marked_install(p):
+ depcache.mark_keep(p)
+ if depcache.inst_count != 0:
+ print "Error undoing the selection for %s (inst_count: %s)" % (
+ x, depcache.inst_count)
print "\r%i/%i=%.3f%% " % (i, all, (float(i) / float(all) * 100)),
print
- print "Trying Upgrade:"
- depcache.Upgrade()
- print "To install: %s " % depcache.InstCount
- print "To remove: %s " % depcache.DelCount
- print "Kept back: %s " % depcache.KeepCount
+ print "Trying upgrade:"
+ depcache.upgrade()
+ print "To install: %s " % depcache.inst_count
+ print "To remove: %s " % depcache.del_count
+ print "Kept back: %s " % depcache.keep_count
print "Trying DistUpgrade:"
- depcache.Upgrade(True)
- print "To install: %s " % depcache.InstCount
- print "To remove: %s " % depcache.DelCount
- print "Kept back: %s " % depcache.KeepCount
+ depcache.upgrade(True)
+ print "To install: %s " % depcache.inst_count
+ print "To remove: %s " % depcache.del_count
+ print "Kept back: %s " % depcache.keep_count
if __name__ == "__main__":