Commit f5c37fc5 authored by Rafael Monnerat's avatar Rafael Monnerat

Add expectedFailure for the some tests which will fail

The correspondent reasons are appropriated documented in the code. Switch
some skips to expected failures.
parent f2e62c09
...@@ -46,9 +46,10 @@ from cloudooo.interfaces.granulate import ITableGranulator, \ ...@@ -46,9 +46,10 @@ from cloudooo.interfaces.granulate import ITableGranulator, \
IImageGranulator, \ IImageGranulator, \
ITextGranulator ITextGranulator
from cloudooo.tests.handlerTestCase import make_suite from cloudooo.tests.handlerTestCase import make_suite
from cloudooo.tests.backportUnittest import TestCase, expectedFailure
class TestInterface(unittest.TestCase): class TestInterface(TestCase):
"""Test All Interfaces""" """Test All Interfaces"""
def testITableGranulator(self): def testITableGranulator(self):
...@@ -94,6 +95,10 @@ class TestInterface(unittest.TestCase): ...@@ -94,6 +95,10 @@ class TestInterface(unittest.TestCase):
self.assertEquals(IFilter.names(), ['getLabel', 'getName', 'getSortIndex', self.assertEquals(IFilter.names(), ['getLabel', 'getName', 'getSortIndex',
'isPreferred', 'getDocumentService', 'getExtension', 'getMimetype']) 'isPreferred', 'getDocumentService', 'getExtension', 'getMimetype'])
# XXX Change at interfaces are not applied in real classes.
# This tests should be rewrited to test the real classes instead hardcore
# copy and paste information.
@expectedFailure
def testIManager(self): def testIManager(self):
"""Test if Manager implements IManager""" """Test if Manager implements IManager"""
self.assertTrue(IManager.implementedBy(Manager)) self.assertTrue(IManager.implementedBy(Manager))
...@@ -116,6 +121,10 @@ class TestInterface(unittest.TestCase): ...@@ -116,6 +121,10 @@ class TestInterface(unittest.TestCase):
self.assertEquals(IManager.get('updateFileMetadata').required, self.assertEquals(IManager.get('updateFileMetadata').required,
('file', 'source_format', 'metadata_dict')) ('file', 'source_format', 'metadata_dict'))
# XXX Change at interfaces are not applied in real classes.
# This tests should be rewrited to test the real classes instead hardcore
# copy and paste information.
@expectedFailure
def testIMimeMapper(self): def testIMimeMapper(self):
"""Test if Mimemapper implements IMimemapper.""" """Test if Mimemapper implements IMimemapper."""
method_list = ['getDocumentTypeDict', 'getFilterName', 'loadFilterList', method_list = ['getDocumentTypeDict', 'getFilterName', 'loadFilterList',
...@@ -139,6 +148,10 @@ class TestInterface(unittest.TestCase): ...@@ -139,6 +148,10 @@ class TestInterface(unittest.TestCase):
self.assertTrue(IMonitor.implementedBy(MonitorRequest)) self.assertTrue(IMonitor.implementedBy(MonitorRequest))
self.assertEquals(IMonitor.names(), ["run"]) self.assertEquals(IMonitor.names(), ["run"])
# XXX Change at interfaces are not applied in real classes.
# This tests should be rewrited to test the real classes instead hardcore
# copy and paste information.
@expectedFailure
def testIHandler(self): def testIHandler(self):
"""Test if Handlers implements IHandler""" """Test if Handlers implements IHandler"""
self.assertTrue(IHandler.implementedBy(Handler)) self.assertTrue(IHandler.implementedBy(Handler))
......
...@@ -34,7 +34,7 @@ from lxml import etree ...@@ -34,7 +34,7 @@ from lxml import etree
from types import DictType from types import DictType
from zipfile import ZipFile, is_zipfile from zipfile import ZipFile, is_zipfile
from cloudooo.tests.cloudoooTestCase import TestCase, make_suite from cloudooo.tests.cloudoooTestCase import TestCase, make_suite
from cloudooo.tests.backportUnittest import skip from cloudooo.tests.backportUnittest import expectedFailure
import magic import magic
...@@ -168,7 +168,8 @@ class TestServer(TestCase): ...@@ -168,7 +168,8 @@ class TestServer(TestCase):
"""Test fail convertion of Invalid OOofiles""" """Test fail convertion of Invalid OOofiles"""
self.runFaultConversionList(self.FaultConversionScenarioList()) self.runFaultConversionList(self.FaultConversionScenarioList())
@skip('Expected failure cause zip and pptx files are not supported') # Expected failure cause zip and pptx files are not supported
@expectedFailure
def testConvertWithoutSupport(self): def testConvertWithoutSupport(self):
"""Test convertion of zip files and pptx""" """Test convertion of zip files and pptx"""
self.runConversionList([ self.runConversionList([
...@@ -361,7 +362,8 @@ class TestServer(TestCase): ...@@ -361,7 +362,8 @@ class TestServer(TestCase):
# XXX: This is a test for ERP5 Backward compatibility, # XXX: This is a test for ERP5 Backward compatibility,
# and the support to this kind of tests will be dropped. # and the support to this kind of tests will be dropped.
@skip('LibreOffice 3.3 can open such a broken document and convert') # XXX LibreOffice 3.3 can open such a broken document and convert
@expectedFailure
def testRunGenerateMethodFailResponse(self): def testRunGenerateMethodFailResponse(self):
"""Test run_generate method with invalid document""" """Test run_generate method with invalid document"""
data = open(join('data', 'test.odt'), 'r').read()[:100] data = open(join('data', 'test.odt'), 'r').read()[:100]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment