Changeset ffb7bf9
- Timestamp:
- 08/13/10 12:37:54 (3 years ago)
- Branches:
- master
- Children:
- b522113
- Parents:
- 2297f7d
- git-author:
- Aurélien Bompard <aurelien@…> (08/13/10 12:37:54)
- git-committer:
- Aurélien Bompard <aurelien@…> (08/13/10 12:37:54)
- Location:
- tests
- Files:
-
- 2 edited
-
data/1.xml (modified) (5 diffs)
-
test_block.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tests/data/1.xml
r7d45d4d rffb7bf9 232 232 Example: 233 233 </text:p> 234 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> * Item 1<text:line-break/> * Item 1.1<text:line-break/> * Item 1.1.1 <text:line-break/> * Item 1.1.2<text:line-break/> * Item 1.1.3<text:line-break/> * Item 1.2<text:line-break/> * Item 2<text:line-break/><text:line-break/> 1. Item 1<text:line-break/> a. Item 1.a<text:line-break/> a. Item 1.b<text:line-break/> i. Item 1.b.i<text:line-break/>i. Item 1.b.ii<text:line-break/> 1. Item 2<text:line-break/>And numbered lists can also be given an explicit number:<text:line-break/> 3. Item 3</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">234 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> * Item 1<text:line-break/><text:s text:c="2"/> * Item 1.1<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>* Item 1.1.1<text:s text:c="2"/> <text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>* Item 1.1.2<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>* Item 1.1.3<text:line-break/><text:s text:c="2"/> * Item 1.2<text:line-break/> * Item 2<text:line-break/><text:line-break/> 1. Item 1<text:line-break/><text:s text:c="2"/> a. Item 1.a<text:line-break/><text:s text:c="2"/> a. Item 1.b<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>i. Item 1.b.i<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>i. Item 1.b.ii<text:line-break/> 1. Item 2<text:line-break/>And numbered lists can also be given an explicit number:<text:line-break/> 3. Item 3</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 235 235 Display: 236 236 </text:p> … … 316 316 Example: 317 317 </text:p> 318 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> llama::<text:line-break/> some kind of mammal, with hair<text:line-break/> ppython::<text:line-break/> some kind of reptile, without hair<text:line-break/>(can you spot the typo?)</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">318 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> llama::<text:line-break/><text:s text:c="2"/> some kind of mammal, with hair<text:line-break/> ppython::<text:line-break/><text:s text:c="2"/> some kind of reptile, without hair<text:line-break/><text:s text:c="2"/> (can you spot the typo?)</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 319 319 Display: 320 320 </text:p> … … 369 369 Example: 370 370 </text:p> 371 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> {{{<text:line-break/> def HelloWorld():<text:line-break/>print "Hello World"<text:line-break/> }}}</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">372 Display: 373 </text:p> 374 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> def HelloWorld():<text:line-break/> print "Hello World"</text:p><!--section level 2-->371 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> {{{<text:line-break/><text:s text:c="2"/>def HelloWorld():<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>print "Hello World"<text:line-break/> }}}</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 372 Display: 373 </text:p> 374 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> def HelloWorld():<text:line-break/><text:s text:c="2"/><text:s text:c="2"/> print "Hello World"</text:p><!--section level 2--> 375 375 <text:h xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Heading_20_2" text:outline-level="2">Blockquotes</text:h> 376 376 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> … … 380 380 Example: 381 381 </text:p> 382 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> This text is a quote from someone else.</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">382 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"><text:s text:c="2"/>This text is a quote from someone else.</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 383 383 Display: 384 384 </text:p> … … 596 596 Example: 597 597 </text:p> 598 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text">{{{<text:line-break/>#!python<text:line-break/>class Test:<text:line-break/><text:line-break/> def __init__(self):<text:line-break/> print "Hello World"<text:line-break/>if __name__ == '__main__':<text:line-break/>Test()<text:line-break/>}}}</text:p>599 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 600 Display: 601 </text:p> 602 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Source_20_Code"><text:span text:style-name="strong">class</text:span> <text:span text:style-name="syntax-highlight.class">Test</text:span>:<text:line-break/> <text:span text:style-name="strong">def</text:span> <text:span text:style-name="syntax-highlight.function">__init__</text:span>(<text:span text:style-name="syntax-highlight.builtin.pseudo">self</text:span>):<text:line-break/> <text:span text:style-name="strong">print</text:span> <text:span text:style-name="syntax-highlight.string">"Hello World"</text:span><text:line-break/><text:span text:style-name="strong">if</text:span> __name__ <text:span text:style-name="strong">==</text:span> <text:span text:style-name="syntax-highlight.string">'__main__'</text:span>:<text:line-break/>Test()</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">598 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text">{{{<text:line-break/>#!python<text:line-break/>class Test:<text:line-break/><text:line-break/><text:s text:c="2"/><text:s text:c="2"/>def __init__(self):<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/>print "Hello World"<text:line-break/>if __name__ == '__main__':<text:line-break/><text:s text:c="2"/> Test()<text:line-break/>}}}</text:p> 599 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 600 Display: 601 </text:p> 602 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Source_20_Code"><text:span text:style-name="strong">class</text:span> <text:span text:style-name="syntax-highlight.class">Test</text:span>:<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:span text:style-name="strong">def</text:span> <text:span text:style-name="syntax-highlight.function">__init__</text:span>(<text:span text:style-name="syntax-highlight.builtin.pseudo">self</text:span>):<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/><text:s text:c="2"/><text:span text:style-name="strong">print</text:span> <text:span text:style-name="syntax-highlight.string">"Hello World"</text:span><text:line-break/><text:span text:style-name="strong">if</text:span> __name__ <text:span text:style-name="strong">==</text:span> <text:span text:style-name="syntax-highlight.string">'__main__'</text:span>:<text:line-break/><text:s text:c="2"/> Test()</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 603 603 Perl: 604 604 </text:p> 605 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Source_20_Code"><text:span text:style-name="strong">my</text:span> (<text:span text:style-name="syntax-highlight.var">$test</text:span>) <text:span text:style-name="strong">=</text:span> <text:span text:style-name="syntax-highlight.number">0</text:span>;<text:line-break/><text:span text:style-name="strong">if</text:span> (<text:span text:style-name="syntax-highlight.var">$test</text:span> <text:span text:style-name="strong">></text:span> <text:span text:style-name="syntax-highlight.number">0</text:span>) {<text:line-break/> <text:span text:style-name="strong">print</text:span> <text:span text:style-name="syntax-highlight.string">"hello"</text:span>;<text:line-break/>}</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body">605 <text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Source_20_Code"><text:span text:style-name="strong">my</text:span> (<text:span text:style-name="syntax-highlight.var">$test</text:span>) <text:span text:style-name="strong">=</text:span> <text:span text:style-name="syntax-highlight.number">0</text:span>;<text:line-break/><text:span text:style-name="strong">if</text:span> (<text:span text:style-name="syntax-highlight.var">$test</text:span> <text:span text:style-name="strong">></text:span> <text:span text:style-name="syntax-highlight.number">0</text:span>) {<text:line-break/><text:s text:c="2"/><text:s text:c="2"/><text:span text:style-name="strong">print</text:span> <text:span text:style-name="syntax-highlight.string">"hello"</text:span>;<text:line-break/>}</text:p><text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Text_20_body"> 606 606 See <text:a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="/wiki/WikiProcessors">WikiProcessors</text:a> for more information. 607 607 </text:p> -
tests/test_block.py
r2a386e2 rffb7bf9 38 38 odt = xhtml2odt(html) 39 39 print odt 40 # note: one of the spaces below is a non-breaking space, can you spot it ? ;-) 41 assert str(odt) == '<?xml version="1.0" encoding="utf-8"?>\n<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"> Line with spaces </text:p>\n' 40 self.assertEquals(str(odt), '<?xml version="1.0" encoding="utf-8"?>\n<text:p xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" text:style-name="Preformatted_20_Text"><text:s text:c="2"/> Line with spaces </text:p>\n') 42 41 43 42 def test_pre4(self):
Note: See TracChangeset
for help on using the changeset viewer.
