'Test that we can use a cleanup function.'

def test_cleanup(self):

    cleanup_called = []
    def cleanup_func(key, val):
        cleanup_called.append((key, val))
    cache = lru_cache.LRUCache(max_cache=2, after_cleanup_count=2)
    cache.add('baz', '1', cleanup=cleanup_func)
    cache.add('foo', '2', cleanup=cleanup_func)
    cache.add('biz', '3', cleanup=cleanup_func)
    self.assertEqual([('baz', '1')], cleanup_called)
    cache['foo']
    cache.clear()
    self.assertEqual([('baz', '1'), ('biz', '3'), ('foo', '2')], cleanup_called)
