[py-svn] r32955 - in py/branch/apigen/py/rst: . testing
fijal at codespeak.net
fijal at codespeak.net
Fri Oct 6 14:38:28 CEST 2006
Author: fijal
Date: Fri Oct 6 14:38:26 2006
New Revision: 32955
Modified:
py/branch/apigen/py/rst/rst.py
py/branch/apigen/py/rst/testing/test_rst.py
Log:
Stupid word-reverse stuff and a test for it.
Modified: py/branch/apigen/py/rst/rst.py
==============================================================================
--- py/branch/apigen/py/rst/rst.py (original)
+++ py/branch/apigen/py/rst/rst.py Fri Oct 6 14:38:26 2006
@@ -124,6 +124,7 @@
def grab(buf):
outcome.append(self.indent + self.sep.join(buf))
+ texts.reverse()
while texts:
next = texts[-1]
if lgt + len(self.sep) + len(next) <= self.width or not buf:
@@ -135,7 +136,6 @@
lgt = len(self.indent)
buf = []
grab(buf)
- outcome.reverse()
return "\n".join(outcome)
class SubParagraph(Paragraph):
Modified: py/branch/apigen/py/rst/testing/test_rst.py
==============================================================================
--- py/branch/apigen/py/rst/testing/test_rst.py (original)
+++ py/branch/apigen/py/rst/testing/test_rst.py Fri Oct 6 14:38:26 2006
@@ -35,3 +35,8 @@
def test_link():
expected = "`some link`_\n.. _`some link`: http://codespeak.net\n"
txt = Rest(Paragraph(Link("some link", "http://codespeak.net"))).text()
+
+def test_text():
+ expected = "This is a test!\n"
+ txt = Rest(Paragraph("This is a test!")).text()
+ assert txt == expected
More information about the pytest-commit
mailing list