At http://bzr.arbash-meinel.com/branches/bzr/1.11/fifo_cache
------------------------------------------------------------
revno: 3887
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: John Arbash Meinel <[EMAIL PROTECTED]>
branch nick: fifo_cache
timestamp: Tue 2008-12-09 15:39:17 -0600
message:
Add a test which fails because we don't call cleanup funcs during
deconstruction.
=== modified file 'bzrlib/tests/test_fifo_cache.py'
--- a/bzrlib/tests/test_fifo_cache.py 2008-12-09 21:35:49 +0000
+++ b/bzrlib/tests/test_fifo_cache.py 2008-12-09 21:39:17 +0000
@@ -136,3 +136,16 @@
del log[:]
c.clear()
self.assertEqual([(3, 4)], log)
+
+ def test_cleanup_at_deconstruct(self):
+ log = []
+ def logging_cleanup(key, value):
+ log.append((key, value))
+ c = fifo_cache.FIFOCache()
+ c.add(1, 2, cleanup=logging_cleanup)
+ del c
+ # TODO: We currently don't support calling the cleanup() funcs during
+ # __del__. We might want to consider implementing this.
+ self.expectFailure("we don't call cleanups during __del__",
+ self.assertEqual, [(1, 2)], log)
+ self.assertEqual([(1, 2)], log)
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits