Created
January 8, 2015 07:06
-
-
Save mithrandi/10ef1d58f3ee2d189632 to your computer and use it in GitHub Desktop.
Test for thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_storeOverCollectedItem(self): | |
""" | |
If an item is replaced in the cache, the finalizer from the first item | |
does not remove the second item. | |
""" | |
o1 = Object(1) | |
self.cache.cache(42, o1) | |
gc.disable() | |
del o1 | |
gc.collect() | |
o2 = Object(2) | |
self.cache.cache(42, o2) | |
gc.enable() | |
self.assertEqual(2, self.cache.get(42).name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment