Commit 81e3c2ea authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor to test with all formats and not stop in the first failure

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@42192 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 00bd0b70
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
# #
############################################################################## ##############################################################################
import unittest
from xmlrpclib import ServerProxy, Fault from xmlrpclib import ServerProxy, Fault
from subprocess import Popen, PIPE
from base64 import encodestring, decodestring from base64 import encodestring, decodestring
from cloudoooTestCase import CloudoooTestCase, make_suite from cloudoooTestCase import CloudoooTestCase, make_suite
import magic import magic
...@@ -77,17 +75,14 @@ class TestAllFormats(CloudoooTestCase): ...@@ -77,17 +75,14 @@ class TestAllFormats(CloudoooTestCase):
for extension in extension_list: for extension in extension_list:
try: try:
data_output = self.proxy.convertFile(encodestring(data), data_output = self.proxy.convertFile(encodestring(data),
source_format, source_format,
extension[0]) extension[0])
except Fault, err: except Fault, err:
fault_list.append("%s >> %s - %s" % (source_format, fault_list.append((source_format, extension[0], err.faultString))
extension[0],
err.faultString))
continue
magic_result = file_detector.from_buffer(decodestring(data_output)) magic_result = file_detector.from_buffer(decodestring(data_output))
self.assertEquals(magic_result.endswith(": empty"), False, magic_result) self.assertEquals(magic_result.endswith(": empty"), False, magic_result)
if fault_list != []: if fault_list != []:
raise Fault(1, "\n".join(fault_list)) raise self.fail(fault_list)
def test_suite(): def test_suite():
......
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