Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test volatile property

  • Loading branch information...
commit 7a37484e5c42c04a81ec86f8c88643e5f5e43426 1 parent d1b447c
Robert Niederreiter authored
Showing with 28 additions and 1 deletion.
  1. +28 −1 src/node/ext/zodb/__init__.txt
View
29 src/node/ext/zodb/__init__.txt
@@ -109,7 +109,7 @@ Test OOBTodict::
>>> od is od2
False
-
+
>>> od2.sort(reverse=True)
>>> od2.keys()
['bar', 'foo']
@@ -346,6 +346,33 @@ Fill root with some OOBTNodes and check memory usage::
>>> (new_size - old_size) / 1000
168L
+Test ``volatile_property``::
+
+ >>> from node.ext.zodb import volatile_property
+ >>> class PropTest(object):
+ ... @volatile_property
+ ... def foo(self):
+ ... return 'foo'
+
+ >>> inst = PropTest()
+ >>> 'foo' in dir(inst)
+ True
+
+ >>> '_v_foo' in dir(inst)
+ False
+
+ >>> inst.foo
+ 'foo'
+
+ >>> '_v_foo' in dir(inst)
+ True
+
+ >>> inst._v_foo
+ 'foo'
+
+ >>> inst._v_foo is inst.foo
+ True
+
Cleanup test environment::
>>> connection.close()
Please sign in to comment.
Something went wrong with that request. Please try again.