diff options
Diffstat (limited to 't/unit/utils/test_objects.py')
-rw-r--r-- | t/unit/utils/test_objects.py | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/t/unit/utils/test_objects.py b/t/unit/utils/test_objects.py deleted file mode 100644 index a1ad2000..00000000 --- a/t/unit/utils/test_objects.py +++ /dev/null @@ -1,51 +0,0 @@ -from kombu.utils.objects import cached_property - - -class test_cached_property: - - def test_deleting(self): - - class X: - xx = False - - @cached_property - def foo(self): - return 42 - - @foo.deleter # noqa - def foo(self, value): - self.xx = value - - x = X() - del(x.foo) - assert not x.xx - x.__dict__['foo'] = 'here' - del(x.foo) - assert x.xx == 'here' - - def test_when_access_from_class(self): - - class X: - xx = None - - @cached_property - def foo(self): - return 42 - - @foo.setter # noqa - def foo(self, value): - self.xx = 10 - - desc = X.__dict__['foo'] - assert X.foo is desc - - assert desc.__get__(None) is desc - assert desc.__set__(None, 1) is desc - assert desc.__delete__(None) is desc - assert desc.setter(1) - - x = X() - x.foo = 30 - assert x.xx == 10 - - del(x.foo) |