summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-11-23 14:03:26 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-11-23 14:03:26 +0100
commite88bce2daf00abe508730e1cd7dd5ef4243ec6f7 (patch)
treee0594149926af348bd42a5f42bca3408a12ae064 /tests
parent3dc72516fe915b5ba3722b11e07fb70211169509 (diff)
downloadpython-apt-e88bce2daf00abe508730e1cd7dd5ef4243ec6f7.tar.gz
* tests/refcount.py:
- add tests for install/remove of packages
Diffstat (limited to 'tests')
-rwxr-xr-xtests/refcount.py21
1 files changed, 20 insertions, 1 deletions
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))