[py-svn] r33057 - in py/branch/apigen/py/rst: . testing
fijal at codespeak.net
fijal at codespeak.net
Mon Oct 9 16:20:14 CEST 2006
Author: fijal
Date: Mon Oct 9 16:20:12 2006
New Revision: 33057
Modified:
py/branch/apigen/py/rst/rst.py
py/branch/apigen/py/rst/testing/test_rst.py
Log:
Added list item
Modified: py/branch/apigen/py/rst/rst.py
==============================================================================
--- py/branch/apigen/py/rst/rst.py (original)
+++ py/branch/apigen/py/rst/rst.py Mon Oct 9 16:20:12 2006
@@ -185,6 +185,16 @@
start = "*"
end = "*"
+class ListItem(Paragraph):
+ item_char = "*"
+
+ def text(self):
+ self.indent = self.indent + " "
+ txt = Paragraph.text(self)
+ txt = self.item_char + txt[1:]
+ del self.indent
+ return txt
+
class Link(AbstractText):
start = '`'
end = '`_'
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 Mon Oct 9 16:20:12 2006
@@ -40,3 +40,8 @@
expected = "This is a test!\n"
txt = Rest(Paragraph("This is a test!")).text()
assert txt == expected
+
+def test_list():
+ expected = "* a\n\n* b\n"
+ txt = Rest(ListItem("a"), ListItem("b")).text()
+ assert txt == expected
More information about the pytest-commit
mailing list