Commit 50845fea authored by Ivan Tyagov's avatar Ivan Tyagov

Clean up and extend test.

parent 0b457521
......@@ -58,21 +58,6 @@ class TestDataIngestion(SecurityTestCase):
for i in xrange(0, len(l), n):
yield l[i:i+n]
def getIngestionPolicy(self, reference, ingestion_script):
ingestion_policy = self.portal.portal_catalog.getResultValue(
portal_type = 'Ingestion Policy',
reference = reference)
if ingestion_policy != None: return ingestion_policy
ingestion_policy = self.portal.portal_ingestion_policies.newContent( \
id = reference,
portal_type ='Ingestion Policy',
reference = reference,
version = '001',
script_id = ingestion_script)
ingestion_policy.validate()
self.tic()
return ingestion_policy
def getDataIngestion(self, reference):
data_ingestion = self.portal.portal_catalog.getResultValue(
portal_type = 'Data Ingestion',
......@@ -142,14 +127,15 @@ class TestDataIngestion(SecurityTestCase):
data_stream_data = data_stream.getData()
self.assertEqual(data_chunk, data_stream_data)
# check Data Stream and Data Set
self.assertEqual('validated', data_stream.getValidationState())
def test_01_DefaultEbulkIngestion(self):
"""
Test default ingestion with ebulk too.
"""
delimiter = ","
extension = self.CSV
self.stepIngest(extension, delimiter)
self.stepIngest(self.CSV, ",")
def test_02_DefaultSplitIngestion(self):
"""
......@@ -191,4 +177,4 @@ class TestDataIngestion(SecurityTestCase):
# check resulting Data Stream
data_stream = self.getDataStream(ingestion_reference)
self.assertEqual(data_chunk, data_stream.getData())
\ No newline at end of file
self.assertEqual(data_chunk, data_stream.getData())
......@@ -46,9 +46,9 @@
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:108, 4: Unused variable \'ingestion_id\' (unused-variable)</string>
<string>W:115, 34: Unused variable \'i\' (unused-variable)</string>
<string>W:115, 76: Unused variable \'j\' (unused-variable)</string>
<string>W: 93, 4: Unused variable \'ingestion_id\' (unused-variable)</string>
<string>W:100, 34: Unused variable \'i\' (unused-variable)</string>
<string>W:100, 76: Unused variable \'j\' (unused-variable)</string>
</tuple>
</value>
</item>
......
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