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/refcount.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/refcount.py')
| -rwxr-xr-x | tests/refcount.py | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/tests/refcount.py b/tests/refcount.py deleted file mode 100755 index a29744ae..00000000 --- a/tests/refcount.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/python-dbg - -from pprint import pprint, pformat -import apt -import sys -import gc -import difflib - -# get initial cache -print sys.gettotalrefcount() -progress= apt.progress.OpTextProgress() -c = apt.Cache(progress) -print "refcount after first cache instance: ", sys.gettotalrefcount() - -# test open() -c.open(progress) -print "refcount after cache open: ", sys.gettotalrefcount() -#pprint(sys.getobjects(10)) - -c.open(apt.progress.OpProgress()) -print "refcount after seconf cache open: ", sys.gettotalrefcount() -#pprint(sys.getobjects(10)) - -# FIXME: find a way to get a efficient diff -#before = gc.get_objects() -#c.open(apt.progress.OpProgress()) -#after = gc.get_objects() - - -# test update() -print "refcount before cache.update(): ", sys.gettotalrefcount() -c.update() -gc.collect() -print "refcount after cache.update(): ", sys.gettotalrefcount() -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)) |
