[Erp5-report] r37536 gabriel - /erp5/trunk/utils/cloudooo/cloudooo/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 5 14:35:47 CEST 2010


Author: gabriel
Date: Thu Aug  5 14:35:45 2010
New Revision: 37536

URL: http://svn.erp5.org?rev=37536&view=rev
Log:
add a test to validate if a file in zipfile has prefix 'impr.html'. And bug fix in cloudoooTestCase because the object config need read some configuration

Modified:
    erp5/trunk/utils/cloudooo/cloudooo/tests/cloudoooTestCase.py
    erp5/trunk/utils/cloudooo/cloudooo/tests/testServer.py

Modified: erp5/trunk/utils/cloudooo/cloudooo/tests/cloudoooTestCase.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/tests/cloudoooTestCase.py?rev=37536&r1=37535&r2=37536&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/tests/cloudoooTestCase.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/tests/cloudoooTestCase.py [utf8] Thu Aug  5 14:35:45 2010
@@ -47,7 +47,7 @@ def make_suite(test_case):
 
 def loadConfig(path=None):
   conf_path = path or join(testcase_path, "..", "samples/cloudooo.conf")
-  config.read()
+  config.read(conf_path)
 
 def startFakeEnvironment(start_openoffice=True, conf_path=None):
   """Create a fake environment"""

Modified: erp5/trunk/utils/cloudooo/cloudooo/tests/testServer.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/tests/testServer.py?rev=37536&r1=37535&r2=37536&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/tests/testServer.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/tests/testServer.py [utf8] Thu Aug  5 14:35:45 2010
@@ -421,7 +421,7 @@ at least v2.0 to extract\n'
     self.assertEquals(response_code, 200)
     self.assertEquals(type(response_dict), DictType)
     self.assertNotEquals(response_dict['data'], '')
-    self.assertEquals(response_dict['mime'], 'text/html')
+    self.assertEquals(response_dict['mime'], 'application/zip')
     output_url = "./output/zip.zip"
     open(output_url, 'w').write(decodestring(response_dict['data']))
     self.assertTrue(is_zipfile(output_url))
@@ -443,7 +443,17 @@ at least v2.0 to extract\n'
     self.assertEquals(response_code, 200)
     self.assertEquals(type(response_dict), DictType)
     self.assertNotEquals(response_dict['data'], '')
-    self.assertEquals(response_dict['mime'], 'text/html')
+    self.assertEquals(response_dict['mime'], 'application/zip')
+    output_url = "./output/zip.zip"
+    open(output_url, 'w').write(decodestring(response_dict['data']))
+    self.assertTrue(is_zipfile(output_url))
+    filename_list = [file.filename for file in ZipFile(output_url).filelist]
+    for filename in filename_list:
+      if filename.endswith("impr.html"):
+        break
+    else:
+      self.fail("Not exists one file with 'impr.html' format")
+
 
   def testRunGenerateMethodFailResponse(self):
     """Test run_generate method with invalid document"""




More information about the Erp5-report mailing list