• Jérome Perrin's avatar
    testOooInterface: use zope.interface built in verify utility · 952d74b0
    Jérome Perrin authored
    instead of re-implementing our own. Updating to zope.interface 5.4
    caused test failures:
    
          File "cloudooo/handler/ooo/tests/testOooInterface.py", line 90, in testIOdfDocument
            self.assertEquals(IOdfDocument.names(), method_list)
        AssertionError: Lists differ: ['getFile', 'source_format', '... != ['getContentXml', 'parsed_cont...
    
        First differing element 0:
        'getFile'
        'getContentXml'
    
        - ['getFile', 'source_format', 'getContentXml', 'parsed_content']
        + ['getContentXml', 'parsed_content', 'source_format', 'getFile']
    
    This is because Interface.name() order is unspecified.
    
    As we could see in the XXX comments in the test, hardcoding the method
    names from the interface was not ideal, using the built-in verifyClass
    is better because it performs more checks and because error reporting
    is also much more detailed.
    
    cf. https://zopeinterface.readthedocs.io/en/latest/verify.html
    952d74b0
testOooInterface.py 4.28 KB