#5 Odt converter tests fail with python 2.4.4

open
nobody
None
5
2007-02-20
2007-02-20
Paul Wise
No

The two odt converter tests from khmerconverter 1.1 fail under python 2.4.4. The log file is below.

$ python modules/legacyConvertOdt.py
.F..
======================================================================
FAIL: testProcessContent (__main__.TestConvertOdt)
----------------------------------------------------------------------
Traceback (most recent call last):
File "modules/legacyConvertOdt.py", line 223, in testProcessContent
self.assertEqual(legacyConvertOdt().processContent(myXml.encode('utf-8')), convertedXml)
AssertionError: u'<?xml version="1.0" ?>\n<office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"><office:font-face-decls><style:font-face style:name="ABC-TEXT-05" svg:font-family="ABC-TEXT-05"/></office:font-face-decls><office:automatic-styles><style:style style:family="text" style:name="kc-1.0-kstyle"><style:text-properties style:font-name="ABC-TEXT-05"/></style:style></office:automatic-styles><office:body><office:text><text:p text:style-name="Standard"><text:span text:style-name="kc-1.0-kstyle">kxK</text:span>abc<text:span text:style-name="kc-1.0-kstyle">c q C</text:span>xyz</text:p></office:text></office:body></office:document-content>' != u'<?xml version="1.0" ?><office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"><office:font-face-decls><style:font-face style:name="ABC-TEXT-05" svg:font-family="ABC-TEXT-05"/></office:font-face-decls><office:automatic-styles><style:style style:family="text" style:name="kc-1.0-kstyle"><style:text-properties style:font-name="ABC-TEXT-05"/></style:style></office:automatic-styles><office:body><office:text><text:p text:style-name="Standard"><text:span text:style-name="kc-1.0-kstyle">kxK</text:span>abc<text:span text:style-name="kc-1.0-kstyle">c q C</text:span>xyz</text:p></office:text></office:body></office:document-content>'

----------------------------------------------------------------------
Ran 4 tests in 0.020s

FAILED (failures=1)
$ python modules/unicodeConvertOdt.py
F..
======================================================================
FAIL: testModifyStyle (__main__.TestConvertOdt)
----------------------------------------------------------------------
Traceback (most recent call last):
File "modules/unicodeConvertOdt.py", line 203, in testModifyStyle
self.assertEqual(unicodeConvertOdt().processStyle(xmldata), modxmldata)
AssertionError: '<?xml version="1.0" encoding="utf-8"?>\n<office:document-styles office:version="1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"><office:font-face-decls><style:font-face style:font-pitch="variable" style:name="Khmer OS" svg:font-family="Khmer OS"/></office:font-face-decls><office:styles><style:style style:family="text" style:name="Khmer" style:parent-style-name="Default_20_Paragraph_20_Font"><style:text-properties fo:font-size="16pt" style:font-name-complex="Khmer OS" style:font-size-asian="16pt"/></style:style></office:styles><office:automatic-styles/><office:master-styles/></office:document-styles>' != '<?xml version="1.0" encoding="utf-8"?><office:document-styles office:version="1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"><office:font-face-decls><style:font-face style:font-pitch="variable" style:name="Khmer OS" svg:font-family="Khmer OS"/></office:font-face-decls><office:styles><style:style style:family="text" style:name="Khmer" style:parent-style-name="Default_20_Paragraph_20_Font"><style:text-properties fo:font-size="16pt" style:font-name-complex="Khmer OS" style:font-size-asian="16pt"/></style:style></office:styles><office:automatic-styles/><office:master-styles/></office:document-styles>'

----------------------------------------------------------------------
Ran 3 tests in 0.005s

FAILED (failures=1)
$ python -V
Python 2.4.4

Discussion

  • Paul Wise
    Paul Wise
    2007-02-20

    Logged In: YES
    user_id=35028
    Originator: YES

    The tests fail in khmerconverter 1.3 too:

    $ python modules/legacyConvertOdt.py
    .E..
    ======================================================================
    ERROR: testProcessContent (__main__.TestConvertOdt)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "modules/legacyConvertOdt.py", line 227, in testProcessContent
    myXml = header + \ UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 0: ordinal not in range(128)

    ----------------------------------------------------------------------
    Ran 4 tests in 0.016s

    FAILED (errors=1)
    $ python modules/unicodeConvertOdt.py
    F..
    ======================================================================
    FAIL: testModifyStyle (__main__.TestConvertOdt)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "modules/unicodeConvertOdt.py", line 231, in testModifyStyle
    self.assertEqual(unicodeConvertOdt().processStyle(xmldata), modxmldata)
    AssertionError: '<?xml version="1.0" encoding="utf-8"?>\n<office:document-styles office:version="1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"><office:font-face-decls><style:font-face style:font-pitch="variable" style:name="Khmer OS" svg:font-family="Khmer OS"/></office:font-face-decls></office:document-styles>' != '<?xml version="1.0" encoding="utf-8"?><office:document-styles office:version="1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"><office:font-face-decls><style:font-face style:font-pitch="variable" style:name="Khmer OS" svg:font-family="Khmer OS"/></office:font-face-decls></office:document-styles>'

    ----------------------------------------------------------------------
    Ran 3 tests in 0.005s

    FAILED (failures=1)