def __delete__(self, obj):
obj.__dict__.pop(self.__name__, None)
+ def __set__(self, obj, value):
+ obj.__dict__[self.__name__] = (value, time())
+
def _prepare_func(self, func):
self.func = func
if func:
self.assert_cached(Check(), None)
+ def test_set_cached_property(self):
+ Check = CheckFactory(self.cached_property_factory)
+ check = Check()
+ check.add_cached = 'foo'
+ self.assertEqual(check.add_cached, 'foo')
+ self.assertEqual(check.cached_total, 0)
+
def test_threads(self):
Check = CheckFactory(self.cached_property_factory, threadsafe=True)
check = Check()