[Checkins] SVN: zc.zk/trunk/src/zc/zk/ Fixed: nonsensical error messages when trying to import properties at
jim
cvs-admin at zope.org
Tue Nov 27 18:10:33 UTC 2012
Log message for revision 128448:
Fixed: nonsensical error messages when trying to import properties at
the top-level of an import file.
Changed:
U zc.zk/trunk/src/zc/zk/README.txt
U zc.zk/trunk/src/zc/zk/__init__.py
U zc.zk/trunk/src/zc/zk/tests.py
-=-
Modified: zc.zk/trunk/src/zc/zk/README.txt
===================================================================
--- zc.zk/trunk/src/zc/zk/README.txt 2012-11-27 14:07:28 UTC (rev 128447)
+++ zc.zk/trunk/src/zc/zk/README.txt 2012-11-27 18:10:32 UTC (rev 128448)
@@ -1213,6 +1213,12 @@
Change History
==============
+1.1.1 (2012-??-??)
+------------------
+
+Fixed: nonsensical error messages when trying to import properties at
+ the top-level of an import file.
+
1.1.0 (2012-11-07)
------------------
Modified: zc.zk/trunk/src/zc/zk/__init__.py
===================================================================
--- zc.zk/trunk/src/zc/zk/__init__.py 2012-11-27 14:07:28 UTC (rev 128447)
+++ zc.zk/trunk/src/zc/zk/__init__.py 2012-11-27 18:10:32 UTC (rev 128448)
@@ -967,7 +967,8 @@
indents[-1] = indent, data
else:
if indents[-2][1] is root:
- raise ValueError("Can't above imported nodes.")
+ raise ValueError(
+ "Can't import properties above imported nodes.")
properties = indents[-2][1].properties
name, value = data
if name in properties:
Modified: zc.zk/trunk/src/zc/zk/tests.py
===================================================================
--- zc.zk/trunk/src/zc/zk/tests.py 2012-11-27 14:07:28 UTC (rev 128447)
+++ zc.zk/trunk/src/zc/zk/tests.py 2012-11-27 18:10:32 UTC (rev 128448)
@@ -1570,6 +1570,19 @@
>>> zk.close()
"""
+def cant_import_top_level_properties():
+ r"""
+ >>> zk = zc.zk.ZooKeeper('zookeeper.example.com:2181')
+ >>> zk.import_tree('x = 1')
+ Traceback (most recent call last):
+ ...
+ ValueError: Can't import properties above imported nodes.
+ >>> zk.import_tree('/y\nx = 1')
+ Traceback (most recent call last):
+ ...
+ ValueError: Can't import properties above imported nodes.
+ """
+
event = threading.Event()
def check_async(show=True, expected_status=0):
event.clear()
More information about the checkins
mailing list