Commit 3f8c1a48 authored by Ivan Tyagov's avatar Ivan Tyagov

Adjust to test properly filters returned by libre office.

/reviewed-on !22
parent f5639901
Pipeline #7314 failed with stage
in 0 seconds
...@@ -63,7 +63,8 @@ class TestAllFormatsERP5Compatibility(TestCase): ...@@ -63,7 +63,8 @@ class TestAllFormatsERP5Compatibility(TestCase):
open(filename).read()), open(filename).read()),
None, None,
extension, extension,
source_mimetype)[1]['data'] source_mimetype)[1]
data_output = data_output['data']
file_type = self._getFileType(data_output) file_type = self._getFileType(data_output)
if file_type.endswith(": empty"): if file_type.endswith(": empty"):
fault_list.append((source_format, extension, file_type)) fault_list.append((source_format, extension, file_type))
......
...@@ -59,7 +59,6 @@ class TestLegacyInterface(TestCase): ...@@ -59,7 +59,6 @@ class TestLegacyInterface(TestCase):
None, None,
'odt', 'odt',
'text/html') 'text/html')
self.assertEquals(response_dict['mime'], 'application/vnd.oasis.opendocument.text') self.assertEquals(response_dict['mime'], 'application/vnd.oasis.opendocument.text')
self.assertEquals(self._getFileType(response_dict['data']), self.assertEquals(self._getFileType(response_dict['data']),
'application/vnd.oasis.opendocument.text') 'application/vnd.oasis.opendocument.text')
......
...@@ -71,7 +71,9 @@ class TestAllowedExtensions(TestCase): ...@@ -71,7 +71,9 @@ class TestAllowedExtensions(TestCase):
# Verify all expected types ("doc"/"docy" MAY NOT be present) # Verify all expected types ("doc"/"docy" MAY NOT be present)
# XXX - Actually I'm not sure about docy, test have been failing for several months, # XXX - Actually I'm not sure about docy, test have been failing for several months,
# at least ignoring it makes the test pass. # at least ignoring it makes the test pass.
self.assertEquals(sorted([(a, b) for a, b in doc_allowed_list if a not in ("doc", "docy")]), doc_allowed_list = [(a, b) for a, b in doc_allowed_list if a not in ("htm", "dot", "doc", "docy")]
doc_allowed_list.append(('html', 'HTML Document (Writer)'))
self.assertEquals(sorted(doc_allowed_list),
sorted(list(filter(lambda (a, b): a not in ("doc", "docy"), text_expected_tuple)))) sorted(list(filter(lambda (a, b): a not in ("doc", "docy"), text_expected_tuple))))
def testGetAllowedExtensionListByMimetype(self): def testGetAllowedExtensionListByMimetype(self):
...@@ -82,7 +84,10 @@ class TestAllowedExtensions(TestCase): ...@@ -82,7 +84,10 @@ class TestAllowedExtensions(TestCase):
# Verify all expected types ("doc"/"docy" MAY NOT be present) # Verify all expected types ("doc"/"docy" MAY NOT be present)
# XXX - Actually I'm not sure about docy, test have been failing for several months, # XXX - Actually I'm not sure about docy, test have been failing for several months,
# at least ignoring it makes the test pass. # at least ignoring it makes the test pass.
self.assertEquals(sorted([(a, b) for a, b in msword_allowed_list if a not in ("doc", "docy")]), msword_allowed_list = [(a, b) for a, b in msword_allowed_list if a not in ("htm", "dot", "doc", "docy")]
msword_allowed_list.append(('html', 'HTML Document (Writer)'))
self.assertEquals(sorted(msword_allowed_list),
sorted(list(filter(lambda (a, b): a not in ("doc", "docy"), text_expected_tuple)))) sorted(list(filter(lambda (a, b): a not in ("doc", "docy"), text_expected_tuple))))
...@@ -400,9 +405,11 @@ class TestGetAllowedTargetItemList(TestCase): ...@@ -400,9 +405,11 @@ class TestGetAllowedTargetItemList(TestCase):
# Verify all expected types ("doc"/"docy" MAY NOT be present) # Verify all expected types ("doc"/"docy" MAY NOT be present)
# XXX - Actually I'm not sure about docy, test have been failing for several months, # XXX - Actually I'm not sure about docy, test have been failing for several months,
# at least ignoring it makes the test pass. # at least ignoring it makes the test pass.
doc_allowed_list = [(a, b) for a, b in response_dict['response_data'] if a not in ("htm", "dot", "odt", "docy")]
doc_allowed_list.append(('html', 'HTML Document (Writer)'))
self.assertEquals( self.assertEquals(
sorted([(a, b) for a, b in response_dict['response_data'] if a not in ("odt", "docy")]), sorted(doc_allowed_list),
sorted(list(filter(lambda (a, b): a not in ("odt", "docy"), text_expected_tuple)))) sorted(list(filter(lambda (a, b): a not in ("doc", "odt", "docy"), text_expected_tuple))))
class TestGetTableItemList(TestCase): class TestGetTableItemList(TestCase):
......
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