Changeset 11ac809
- Timestamp:
- 07/15/11 12:33:15 (23 months ago)
- Branches:
- master
- Children:
- d79635c
- Parents:
- 4ee9377
- git-author:
- Aurelien BOMPARD <aurelien.bompard@…> (07/15/11 12:33:15)
- git-committer:
- Aurelien BOMPARD <aurelien.bompard@…> (07/15/11 12:33:15)
- Files:
-
- 1 added
- 2 edited
-
tests/test_specific.py (modified) (1 diff)
-
xsl/specific.xsl (modified) (1 diff)
-
xsl/specific/lyx.xsl (added)
Legend:
- Unmodified
- Added
- Removed
-
tests/test_specific.py
rf2fad80 r11ac809 171 171 172 172 173 class SpecificLyx(unittest.TestCase): 174 175 def test_div_standard(self): 176 html = ('<html xmlns="http://www.w3.org/1999/xhtml">' 177 '<div class="standard">Test</div>' 178 '</html>') 179 odt = xhtml2odt(html) 180 self.assertEquals(odt, 181 '<text:p text:style-name="Text_20_body">Test</text:p>') 182 183 def test_date(self): 184 html = ('<html xmlns="http://www.w3.org/1999/xhtml">' 185 '<div class="date">Test</div>' 186 '</html>') 187 odt = xhtml2odt(html) 188 self.assertEquals(odt, 189 '<text:p text:style-name="Subtitle">Test</text:p>') 190 191 def test_subject(self): 192 html = ('<html xmlns="http://www.w3.org/1999/xhtml">' 193 '<div class="subject">Test</div>' 194 '</html>') 195 odt = xhtml2odt(html) 196 self.assertEquals(odt, 197 '<text:p text:style-name="Title">Test</text:p>') 198 199 def test_title(self): 200 html = ('<html xmlns="http://www.w3.org/1999/xhtml">' 201 '<h1 class="title">Test</h1>' 202 '</html>') 203 odt = xhtml2odt(html) 204 self.assertEquals(odt, 205 '<text:p text:style-name="Title">Test</text:p>') 206 207 def test_subtitle(self): 208 html = ('<html xmlns="http://www.w3.org/1999/xhtml">' 209 '<h1 class="subtitle">Test</h1>' 210 '</html>') 211 odt = xhtml2odt(html) 212 self.assertEquals(odt, 213 '<text:p text:style-name="Subtitle">Test</text:p>') 214 215 def test_footnote(self): 216 html = ('<html xmlns="http://www.w3.org/1999/xhtml">' 217 '<div class="standard">Main text' 218 '<div class="foot">' 219 '<span class="foot_label">1</span>' 220 '<div class="foot_inner">Note content</div>' 221 '</div>' 222 '</div></html>') 223 odt = xhtml2odt(html) 224 self.assertEquals(odt, '<text:p text:style-name="Text_20_body">' 225 'Main text<text:note text:note-class="footnote"><text:note-body>' 226 '<text:p text:style-name="Footnote">Note content</text:p>' 227 '</text:note-body></text:note></text:p>') 228 229 173 230 174 231 if __name__ == '__main__': -
xsl/specific.xsl
rf2fad80 r11ac809 54 54 <xsl:include href="specific/geshi.xsl"/> 55 55 <xsl:include href="specific/elyxer.xsl"/> 56 <xsl:include href="specific/lyx.xsl"/> 56 57 57 58 </xsl:stylesheet>
Note: See TracChangeset
for help on using the changeset viewer.
