[Erp5-report] r38720 kazuhiko - in /erp5/trunk/products/ERP5OOo/tests: ./ test_document/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 28 15:31:39 CEST 2010


Author: kazuhiko
Date: Tue Sep 28 15:31:37 2010
New Revision: 38720

URL: http://svn.erp5.org?rev=38720&view=rev
Log:
check if ingested File document works fine with SearchableText() method, that currently fails for XML ingestion.

Added:
    erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.rss
    erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.xml
Modified:
    erp5/trunk/products/ERP5OOo/tests/testIngestion.py

Modified: erp5/trunk/products/ERP5OOo/tests/testIngestion.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/testIngestion.py?rev=38720&r1=38719&r2=38720&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/testIngestion.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/tests/testIngestion.py [utf8] Tue Sep 28 15:31:37 2010
@@ -290,6 +290,9 @@ class TestIngestion(ERP5TypeTestCase):
         self.assertEquals(document.getExternalProcessingState(), 'converted')
         self.assert_('magic' in document.SearchableText())
         self.assert_('magic' in str(document.asText()))
+      else:
+        # check if SearchableText() does not raise any exception
+        document.SearchableText()
 
   def checkDocumentExportList(self, document_id, format, asserted_target_list):
     """
@@ -470,6 +473,13 @@ class TestIngestion(ERP5TypeTestCase):
     """
     self.newEmptyCataloggedDocument('Image', 'six')
 
+  def stepCreateFileDocument(self, sequence=None, sequence_list=None, **kw):
+    """
+      Create an empty File document with ID 'file'
+      This document will be used in most tests.
+    """
+    self.newEmptyCataloggedDocument('File', 'file')
+
   def stepCheckEmptyState(self, sequence=None, sequence_list=None, **kw):
     """
       Check if the document is in "empty" processing state
@@ -731,6 +741,13 @@ class TestIngestion(ERP5TypeTestCase):
     format_list = ['jpg', 'gif', 'bmp', 'png']
     self.ingestFormatList('six', format_list, 'Image')
 
+  def stepIngestFileFormats(self, sequence=None, sequence_list=None, **kw):
+    """
+      ingest all supported file formats
+    """
+    format_list = ['txt', 'rss', 'xml',]
+    self.ingestFormatList('file', format_list)
+
   def stepCheckTextDocumentExportList(self, sequence=None, sequence_list=None, **kw):
     self.checkDocumentExportList('one', 'doc', ['pdf', 'doc', 'rtf', 'writer.html', 'txt'])
 
@@ -1135,6 +1152,14 @@ class TestIngestion(ERP5TypeTestCase):
                 ]
     self.playSequence(step_list, quiet)
 
+  def test_05_FormatIngestionFile(self, quiet=QUIET, run=RUN_ALL_TEST):
+    if not run: return
+    if not quiet: printAndLog('test_05_FormatIngestion')
+    step_list = ['stepCleanUp'
+                 ,'stepCreateFileDocument'
+                 ,'stepIngestFileFormats'
+                ]
+    self.playSequence(step_list, quiet)
 
   # Test generation of files in all possible formats
   # which means check if they have correct lists of available formats for export

Added: erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.rss
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.rss?rev=38720&view=auto
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.rss (added)
+++ erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.rss [utf8] Tue Sep 28 15:31:37 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
+  <channel>
+    <atom:link rel="self" type="application/rss+xml" href="http://example.com/WebSection_viewContentListAsRSS"/>
+    <title>example.com</title>
+    <link>http://example.com</link>
+    <description/>
+    <item>
+      <guid>http://example.com/document_module/2</guid>
+      <link>http://example.com/document_module/2</link>
+      <description/>
+      <pubDate>Mon, 27 Sep 2010 01:00:00 +0200</pubDate>
+      <title>title of document 2</title>
+    </item>
+    <item>
+      <guid>http://example.com/document_module/1</guid>
+      <link>http://example.com/document_module/1</link>
+      <description/>
+      <pubDate>Mon, 27 Sep 2010 00:00:00 +0200</pubDate>
+      <title>title of document 1</title>
+    </item>
+  </channel>
+</rss>

Added: erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.xml?rev=38720&view=auto
==============================================================================
--- erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.xml (added)
+++ erp5/trunk/products/ERP5OOo/tests/test_document/TEST-en-002.xml [utf8] Tue Sep 28 15:31:37 2010
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
+  <channel>
+    <atom:link rel="self" type="application/rss+xml" href="http://example.com/WebSection_viewContentListAsRSS"/>
+    <title>example.com</title>
+    <link>http://example.com</link>
+    <description/>
+    <item>
+      <guid>http://example.com/document_module/2</guid>
+      <link>http://example.com/document_module/2</link>
+      <description/>
+      <pubDate>Mon, 27 Sep 2010 01:00:00 +0200</pubDate>
+      <title>title of document 2</title>
+    </item>
+    <item>
+      <guid>http://example.com/document_module/1</guid>
+      <link>http://example.com/document_module/1</link>
+      <description/>
+      <pubDate>Mon, 27 Sep 2010 00:00:00 +0200</pubDate>
+      <title>title of document 1</title>
+    </item>
+  </channel>
+</rss>




More information about the Erp5-report mailing list