[Kss-devel] Fwd: A bug report and the patch about the parentnode selector (a more test included)
程任全
chengrenquan at zopen.cn
Fri Mar 23 02:20:17 CET 2007
I found the the class in plugins/core/commands.py did not agree with
its interface defined in plugins/core/interfaces.py, this is an
appreant error.
here follows the little patch.
Index: plugins/core/commands.py
===================================================================
--- plugins/core/commands.py (revision 40871)
+++ plugins/core/commands.py (working copy)
@@ -19,11 +19,11 @@
def getHtmlIdSelector(self, selector):
return HtmlIdSelector(selector)
- def getSameNodeSelector(self, selector):
- return SameNodeSelector(selector)
+ def getSameNodeSelector(self):
+ return SameNodeSelector()
- def getParentNodeSelector(self):
- return ParentNodeSelector()
+ def getParentNodeSelector(self, selector):
+ return ParentNodeSelector(selector)
# XXX the list is not full: maybe complete them?
Index: tests/test_azaxview_core.py
===================================================================
--- tests/test_azaxview_core.py (revision 40871)
+++ tests/test_azaxview_core.py (working copy)
@@ -125,6 +125,20 @@
'''
self.assertCommandsEqual(result, awaited)
+ def test_parentNode(self):
+ view = self.createView()
+ core = view.getCommandSet('core')
+ selector = core.getParentNodeSelector('div')
+ core.replaceInnerHTML(selector, 'OK')
+ result = view.render()
+ awaited = u'''\
+<kukit:command selector="div" name="replaceInnerHTML"
+ selectorType="parentnode">
+ <kukit:param name="html">OK</kukit:param>
+</kukit:command>
+'''
+ self.assertCommandsEqual(result, awaited)
+
def afterSetUp(self):
KssViewTestCase.afterSetUp(self)
self.setDebugRequest()
More information about the Kss-devel
mailing list