[Zope-Checkins] CVS: Zope/lib/python/StructuredText/tests - testStructuredText.py:1.1.46.3
Andreas Jung
andreas@zope.com
Fri, 19 Oct 2001 09:29:01 -0400
Update of /cvs-repository/Zope/lib/python/StructuredText/tests
In directory cvs.zope.org:/tmp/cvs-serv1852
Modified Files:
Tag: Zope-2_4-branch
testStructuredText.py
Log Message:
backport from the trunk
=== Zope/lib/python/StructuredText/tests/testStructuredText.py 1.1.46.2 => 1.1.46.3 ===
res = HTML(stxtxt,level=1,header=0)
if res.find(expected)==-1:
- print res
+ print "Text: ",stxtxt
+ print "Converted:",res
+ print "Expected: ",expected
raise AssertionError,"basic test failed for '%s'" % stxtxt
+
def testUnderline(self):
"""underline"""
- self._test("xx _this is html_ xx","xx <u>this is html</u> xx")
+ self._test("xx _this is html_ xx",
+ "xx <u>this is html</u> xx")
def testEmphasis(self):
""" emphasis """
- self._test("xx *this is html* xx","xx <em>this is html</em> xx")
+ self._test("xx *this is html* xx",
+ "xx <em>this is html</em> xx")
def testStrong(self):
""" strong """
@@ -227,11 +232,24 @@
'<a href="index_html">index_html</a>')
- def testUnderscoresInLiteral(self):
+ def testUnderscoresInLiteral1(self):
+ """ underscores in literals shouldn't do unterlining """
+
+ self._test("def __init__(self)",
+ "def __init__(self)")
+
+ def testUnderscoresInLiteral2(self):
""" underscores in literals shouldn't do unterlining """
self._test("this is '__a_literal__' eh",
"<code>__a_literal__</code>")
+
+
+ def testUnderlinesWithoutWithspaces(self):
+ """ underscores in literals shouldn't do unterlining """
+
+ self._test("Zopes structured_text is sometimes a night_mare",
+ "Zopes structured_text is sometimes a night_mare")
def test_suite():
suite = unittest.TestSuite()