From e88bce2daf00abe508730e1cd7dd5ef4243ec6f7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 23 Nov 2007 14:03:26 +0100 Subject: * tests/refcount.py: - add tests for install/remove of packages --- tests/refcount.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/refcount.py b/tests/refcount.py index e8bd9c6d..f3230bd3 100755 --- a/tests/refcount.py +++ b/tests/refcount.py @@ -32,4 +32,23 @@ print "refcount before cache.update(): ", sys.gettotalrefcount() c.update() gc.collect() print "refcount after cache.update(): ", sys.gettotalrefcount() -pprint(sys.getobjects(20)) +c.update() +gc.collect() +print "refcount after second cache.update(): ", sys.gettotalrefcount() +#pprint(sys.getobjects(20)) + + +# test install() +c.open(apt.progress.OpProgress()) +gc.collect() +print "refcount before cache['hello'].markInstall(): ", sys.gettotalrefcount() +c["hello"].markInstall() +c.commit(apt.progress.FetchProgress(), apt.progress.InstallProgress()) +gc.collect() +print "refcount after: ", sys.gettotalrefcount() +c.open(apt.progress.OpProgress()) +c["hello"].markDelete() +c.commit(apt.progress.FetchProgress(), apt.progress.InstallProgress()) +gc.collect() +print "refcount after: ", sys.gettotalrefcount() +pprint(sys.getobjects(10)) -- cgit v1.2.3