Commit 7cf9b582 authored by Ivan Tyagov's avatar Ivan Tyagov

Clean up.

parent 39dde4fa
......@@ -6,7 +6,6 @@ import os
import time
import numpy as np
import base64
from datetime import datetime
class TestDataIngestion(SecurityTestCase):
......@@ -16,23 +15,13 @@ class TestDataIngestion(SecurityTestCase):
PART_3 = REFERENCE_SEPARATOR + "003"
EOF = REFERENCE_SEPARATOR + "EOF"
FIF = REFERENCE_SEPARATOR + "fif"
TXT = REFERENCE_SEPARATOR + "txt"
CSV = REFERENCE_SEPARATOR + "csv"
TSV = REFERENCE_SEPARATOR + "tsv"
GZ = REFERENCE_SEPARATOR + "gz"
NII = REFERENCE_SEPARATOR + "nii"
SIZE_HASH = REFERENCE_SEPARATOR + "fake-size"+ REFERENCE_SEPARATOR + "fake-hash"
SINGLE_INGESTION_END = REFERENCE_SEPARATOR
RANDOM = REFERENCE_SEPARATOR + ''.join([random.choice(string.ascii_letters + string.digits) for _ in xrange(3)])
CHUNK_SIZE_TXT = 50000
CHUNK_SIZE_CSV = 25
REF_PREFIX = "fake-supplier" + REFERENCE_SEPARATOR + "fake-dataset" + REFERENCE_SEPARATOR
REF_SUPPLIER_PREFIX = "fake-supplier" + REFERENCE_SEPARATOR
INGESTION_SCRIPT = 'HandleFifEmbulkIngestion'
INVALID = "_invalid"
NEW = "_NEW"
FALSE = "FALSE"
TRUE = "TRUE"
def getTitle(self):
return "DataIngestionTest"
......@@ -42,7 +31,7 @@ class TestDataIngestion(SecurityTestCase):
'erp5_wendelin', 'erp5_callables', 'erp5_core')
def afterSetUp(self):
self.context = self.portal #.UnitTest_getContext()
self.context = self.portal
self.assertEqual(self.REFERENCE_SEPARATOR, self.portal.getIngestionReferenceDictionary()["reference_separator"])
self.assertEqual(self.INVALID, self.portal.getIngestionReferenceDictionary()["invalid_suffix"])
self.assertEqual(self.EOF, self.REFERENCE_SEPARATOR + self.portal.getIngestionReferenceDictionary()["split_end_suffix"])
......@@ -69,12 +58,6 @@ class TestDataIngestion(SecurityTestCase):
for i in xrange(0, len(l), n):
yield l[i:i+n]
def generateRawDataBytesAndArray(self):
url = 'data_stream_module/mne_sample_for_test'
sample_data_stream = self.context.restrictedTraverse(url)
raw_data, array, json_data = self.context.generateRawData(sample_data_stream)
return raw_data, array, json_data
def getIngestionPolicy(self, reference, ingestion_script):
ingestion_policy = self.portal.portal_catalog.getResultValue(
portal_type = 'Ingestion Policy',
......@@ -208,4 +191,4 @@ class TestDataIngestion(SecurityTestCase):
# check resulting Data Stream
data_stream = self.getDataStream(ingestion_reference)
self.assertEqual(data_chunk, data_stream.getData())
self.assertEqual(data_chunk, data_stream.getData())
\ No newline at end of file
......@@ -46,10 +46,9 @@
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:125, 4: Unused variable \'ingestion_id\' (unused-variable)</string>
<string>W:132, 34: Unused variable \'i\' (unused-variable)</string>
<string>W:132, 76: Unused variable \'j\' (unused-variable)</string>
<string>W: 9, 0: Unused datetime imported from datetime (unused-import)</string>
<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>
</tuple>
</value>
</item>
......@@ -105,24 +104,28 @@
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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