|
From: <mi...@us...> - 2021-07-13 21:52:25
|
Revision: 8802
http://sourceforge.net/p/docutils/code/8802
Author: milde
Date: 2021-07-13 21:52:22 +0000 (Tue, 13 Jul 2021)
Log Message:
-----------
Fix bug #421 Typo in r8766
Also add a test case.
Modified Paths:
--------------
trunk/docutils/docutils/nodes.py
trunk/docutils/test/test_nodes.py
Modified: trunk/docutils/docutils/nodes.py
===================================================================
--- trunk/docutils/docutils/nodes.py 2021-07-12 21:24:09 UTC (rev 8801)
+++ trunk/docutils/docutils/nodes.py 2021-07-13 21:52:22 UTC (rev 8802)
@@ -1972,7 +1972,7 @@
1995.
"""
- optional = (meta)
+ optional = ('meta',)
"""
Tuple containing node class names (as strings).
Modified: trunk/docutils/test/test_nodes.py
===================================================================
--- trunk/docutils/test/test_nodes.py 2021-07-12 21:24:09 UTC (rev 8801)
+++ trunk/docutils/test/test_nodes.py 2021-07-13 21:52:22 UTC (rev 8802)
@@ -733,7 +733,22 @@
['P:test-1'],
['P:2019-10-30']])
+class NodeVisitorTests(unittest.TestCase):
+ def setUp(self):
+ self.document = utils.new_document('test')
+ self.element = nodes.Element()
+ self.visitor = nodes.NodeVisitor(self.document)
+ def test_dispatch_visit_unknown(self):
+ # raise exception if no visit/depart methods are defined for node class
+ self.assertRaises(NotImplementedError,
+ self.visitor.dispatch_visit, self.element)
+
+ def test_dispatch_visit_optional(self):
+ # silently skip nodes of a calss in tuple nodes.NodeVisitor.optional
+ rv = self.visitor.dispatch_visit(nodes.meta())
+ self.assertIsNone(rv)
+
class MiscFunctionTests(unittest.TestCase):
names = [('a', 'a'), ('A', 'a'), ('A a A', 'a a a'),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|