def test_cached_property(): def fun(obj): return fun.value x = cached_property(fun) assert x.__get__(None) is x assert x.__set__(None, None) is x assert x.__delete__(None) is x
def test_cached_property(self): def fun(obj): return fun.value x = utils.cached_property(fun) self.assertIs(x.__get__(None), x) self.assertIs(x.__set__(None, None), x) self.assertIs(x.__delete__(None), x)