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

Clean up and extend test.

parent 0b457521
...@@ -58,21 +58,6 @@ class TestDataIngestion(SecurityTestCase): ...@@ -58,21 +58,6 @@ class TestDataIngestion(SecurityTestCase):
for i in xrange(0, len(l), n): for i in xrange(0, len(l), n):
yield l[i:i+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): def getDataIngestion(self, reference):
data_ingestion = self.portal.portal_catalog.getResultValue( data_ingestion = self.portal.portal_catalog.getResultValue(
portal_type = 'Data Ingestion', portal_type = 'Data Ingestion',
...@@ -143,13 +128,14 @@ class TestDataIngestion(SecurityTestCase): ...@@ -143,13 +128,14 @@ class TestDataIngestion(SecurityTestCase):
data_stream_data = data_stream.getData() data_stream_data = data_stream.getData()
self.assertEqual(data_chunk, data_stream_data) self.assertEqual(data_chunk, data_stream_data)
# check Data Stream and Data Set
self.assertEqual('validated', data_stream.getValidationState())
def test_01_DefaultEbulkIngestion(self): def test_01_DefaultEbulkIngestion(self):
""" """
Test default ingestion with ebulk too. Test default ingestion with ebulk too.
""" """
delimiter = "," self.stepIngest(self.CSV, ",")
extension = self.CSV
self.stepIngest(extension, delimiter)
def test_02_DefaultSplitIngestion(self): def test_02_DefaultSplitIngestion(self):
""" """
......
...@@ -46,9 +46,9 @@ ...@@ -46,9 +46,9 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W:108, 4: Unused variable \'ingestion_id\' (unused-variable)</string> <string>W: 93, 4: Unused variable \'ingestion_id\' (unused-variable)</string>
<string>W:115, 34: Unused variable \'i\' (unused-variable)</string> <string>W:100, 34: Unused variable \'i\' (unused-variable)</string>
<string>W:115, 76: Unused variable \'j\' (unused-variable)</string> <string>W:100, 76: Unused variable \'j\' (unused-variable)</string>
</tuple> </tuple>
</value> </value>
</item> </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