test/unittest_uilib.py
changeset 10136 c33dcd18e0bb
parent 10116 4e9738f5c798
child 10332 da1cb2b12fe1
equal deleted inserted replaced
10135:52e011d08675 10136:c33dcd18e0bb
   176         incoming = u"""voir le ticket <style type="text/css">@font-face { font-family: "Cambria"; }p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 10pt; font-size: 12pt; font-family: "Times New Roman"; }a:link, span.MsoHyperlink { color: blue; text-decoration: underline; }a:visited, span.MsoHyperlinkFollowed { color: purple; text-decoration: underline; }div.Section1 { page: Section1; }</style></p><p class="MsoNormal">text</p>"""
   176         incoming = u"""voir le ticket <style type="text/css">@font-face { font-family: "Cambria"; }p.MsoNormal, li.MsoNormal, div.MsoNormal { margin: 0cm 0cm 10pt; font-size: 12pt; font-family: "Times New Roman"; }a:link, span.MsoHyperlink { color: blue; text-decoration: underline; }a:visited, span.MsoHyperlinkFollowed { color: purple; text-decoration: underline; }div.Section1 { page: Section1; }</style></p><p class="MsoNormal">text</p>"""
   177         expected = 'voir le ticket <p class="MsoNormal">text</p>'
   177         expected = 'voir le ticket <p class="MsoNormal">text</p>'
   178         self.assertMultiLineEqual(uilib.soup2xhtml(incoming, 'ascii'), expected)
   178         self.assertMultiLineEqual(uilib.soup2xhtml(incoming, 'ascii'), expected)
   179 
   179 
   180     def test_unknown_namespace(self):
   180     def test_unknown_namespace(self):
   181         incoming = '''<table cellspacing="0" cellpadding="0" width="81" border="0" x:str="" style="width: 61pt; border-collapse: collapse">
   181         incoming = '''<table cellspacing="0" cellpadding="0" width="81" border="0" x:str="" style="width: 61pt; border-collapse: collapse">\
   182 <colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962"/></colgroup>
   182 <colgroup><col width="81" style="width: 61pt; mso-width-source: userset; mso-width-alt: 2962"/></colgroup>\
   183 <tbody><tr height="17" style="height: 12.75pt"><td width="81" height="17" style="border-right: #e0dfe3; border-top: #e0dfe3; border-left: #e0dfe3; width: 61pt; border-bottom: #e0dfe3; height: 12.75pt; background-color: transparent"><font size="2">XXXXXXX</font></td></tr></tbody>
   183 <tbody><tr height="17" style="height: 12.75pt"><td width="81" height="17" style="border-right: #e0dfe3; border-top: #e0dfe3; border-left: #e0dfe3; width: 61pt; border-bottom: #e0dfe3; height: 12.75pt; background-color: transparent"><font size="2">XXXXXXX</font></td></tr></tbody>\
   184 </table>'''
   184 </table>'''
   185         expected = '''<table cellspacing="0" cellpadding="0" width="81" border="0">\
   185         expected = '''<table cellspacing="0" cellpadding="0" width="81" border="0">\
   186 <colgroup><col width="81"/></colgroup>\
   186 <colgroup><col width="81"/></colgroup>\
   187 <tbody><tr height="17"><td width="81" height="17">XXXXXXX</td></tr></tbody>\
   187 <tbody><tr height="17"><td width="81" height="17">XXXXXXX</td></tr></tbody>\
   188 </table>'''
   188 </table>'''