[Erp5-report] r13211 - in /erp5/trunk/utils/oood: test_documents.zip test_new.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Mar 3 16:13:01 CET 2007


Author: bartek
Date: Sat Mar  3 16:12:47 2007
New Revision: 13211

URL: http://svn.erp5.org?rev=13211&view=rev
Log:
added more formats, mostly for importing from; added test for these formats; tidy structure of directories for running tests; added test documents;

Added:
    erp5/trunk/utils/oood/test_documents.zip   (with props)
    erp5/trunk/utils/oood/test_new.py   (with props)

Added: erp5/trunk/utils/oood/test_documents.zip
URL: http://svn.erp5.org/erp5/trunk/utils/oood/test_documents.zip?rev=13211&view=auto
==============================================================================
Binary file - no diff available.

Propchange: erp5/trunk/utils/oood/test_documents.zip
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: erp5/trunk/utils/oood/test_new.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/test_new.py?rev=13211&view=auto
==============================================================================
--- erp5/trunk/utils/oood/test_new.py (added)
+++ erp5/trunk/utils/oood/test_new.py Sat Mar  3 16:12:47 2007
@@ -1,0 +1,95 @@
+#!/usr/bin/python
+##############################################################################
+#
+# Copyright (c) 2002, 2006 Nexedi SARL and Contributors. All Rights Reserved.
+#                    Jean-Paul Smets-Solanes <jp at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+import sys, base64, unittest
+from xmlrpclib import *
+sys.path.append('/etc/oood')
+import config
+
+enc = base64.encodestring
+dec = base64.decodestring
+
+sp = ServerProxy('http://%s:%d' % (config.server_host, config.server_port), allow_none = True)
+
+class TestFileOperations(unittest.TestCase):
+
+  def test_sxc2odf(self):
+    self.convertFile('sxc', 'ods', 's2o')
+
+  def test_sdc2odf(self):
+    self.convertFile('sdc', 'ods', 'sdc2o')
+
+  #def test_pxl2odf(self):
+    #self.convertFile('pxl', 'ods', 'pxl2o')
+
+  def test_sxw2odf(self):
+    self.convertFile('sxw', 'odt', 'sxw2o')
+
+  def test_sdw2odf(self):
+    self.convertFile('sdw', 'odt', 'sdw2o')
+
+  def test_sxi2odf(self):
+    self.convertFile('sxi', 'odp', 'sxi2o')
+
+  def test_sdd2odf(self):
+    self.convertFile('sdd', 'odp', 'sdd2o')
+
+  def test_sxd2odf(self):
+    self.convertFile('sxd', 'odg', 'sxd2o')
+
+  def test_sda2odf(self):
+    self.convertFile('sda', 'odg', 'sda2o')
+
+  def test_odg2svn(self):
+    self.generateFile('odg', 'svg')
+
+  def convertFile(self, src, ext, id=''):
+    if id: id = id + '.'
+    data=open('doc/in/test.%s%s' % (id, src)).read()
+    res=sp.run_convert('test.%s%s' % (id, src),enc(data))
+    self.assert_(res)
+    open('doc/out/test.%sout.%s' % (id, ext), 'w').write(base64.decodestring(res['data']))
+
+  def generateFile(self, src, ext, id=''):
+    if id: id = id + '.'
+    data=open('doc/in/test.%s%s' % (id, src)).read()
+    res=sp.run_generate('test.%s%s' % (id, src), enc(data), None, ext)
+    self.assert_(res)
+    open('doc/out/test.%sout.%s' % (id, ext), 'w').write(base64.decodestring(res['data']))
+
+if __name__=='__main__':
+  tests=(TestFileOperations,)
+  for t in tests:
+    suite=unittest.makeSuite(t)
+    unittest.TextTestRunner(verbosity=2).run(suite)
+
+
+
+
+# vim: filetype=python syntax=python shiftwidth=2 

Propchange: erp5/trunk/utils/oood/test_new.py
------------------------------------------------------------------------------
    svn:executable = *




More information about the Erp5-report mailing list