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

Clean up.

parent 39dde4fa
...@@ -6,7 +6,6 @@ import os ...@@ -6,7 +6,6 @@ import os
import time import time
import numpy as np import numpy as np
import base64 import base64
from datetime import datetime
class TestDataIngestion(SecurityTestCase): class TestDataIngestion(SecurityTestCase):
...@@ -16,23 +15,13 @@ class TestDataIngestion(SecurityTestCase): ...@@ -16,23 +15,13 @@ class TestDataIngestion(SecurityTestCase):
PART_3 = REFERENCE_SEPARATOR + "003" PART_3 = REFERENCE_SEPARATOR + "003"
EOF = REFERENCE_SEPARATOR + "EOF" EOF = REFERENCE_SEPARATOR + "EOF"
FIF = REFERENCE_SEPARATOR + "fif" FIF = REFERENCE_SEPARATOR + "fif"
TXT = REFERENCE_SEPARATOR + "txt"
CSV = REFERENCE_SEPARATOR + "csv" 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" SIZE_HASH = REFERENCE_SEPARATOR + "fake-size"+ REFERENCE_SEPARATOR + "fake-hash"
SINGLE_INGESTION_END = REFERENCE_SEPARATOR 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 CHUNK_SIZE_CSV = 25
REF_PREFIX = "fake-supplier" + REFERENCE_SEPARATOR + "fake-dataset" + REFERENCE_SEPARATOR REF_PREFIX = "fake-supplier" + REFERENCE_SEPARATOR + "fake-dataset" + REFERENCE_SEPARATOR
REF_SUPPLIER_PREFIX = "fake-supplier" + REFERENCE_SEPARATOR REF_SUPPLIER_PREFIX = "fake-supplier" + REFERENCE_SEPARATOR
INGESTION_SCRIPT = 'HandleFifEmbulkIngestion'
INVALID = "_invalid" INVALID = "_invalid"
NEW = "_NEW"
FALSE = "FALSE"
TRUE = "TRUE"
def getTitle(self): def getTitle(self):
return "DataIngestionTest" return "DataIngestionTest"
...@@ -42,7 +31,7 @@ class TestDataIngestion(SecurityTestCase): ...@@ -42,7 +31,7 @@ class TestDataIngestion(SecurityTestCase):
'erp5_wendelin', 'erp5_callables', 'erp5_core') 'erp5_wendelin', 'erp5_callables', 'erp5_core')
def afterSetUp(self): 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.REFERENCE_SEPARATOR, self.portal.getIngestionReferenceDictionary()["reference_separator"])
self.assertEqual(self.INVALID, self.portal.getIngestionReferenceDictionary()["invalid_suffix"]) self.assertEqual(self.INVALID, self.portal.getIngestionReferenceDictionary()["invalid_suffix"])
self.assertEqual(self.EOF, self.REFERENCE_SEPARATOR + self.portal.getIngestionReferenceDictionary()["split_end_suffix"]) self.assertEqual(self.EOF, self.REFERENCE_SEPARATOR + self.portal.getIngestionReferenceDictionary()["split_end_suffix"])
...@@ -69,12 +58,6 @@ class TestDataIngestion(SecurityTestCase): ...@@ -69,12 +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 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): def getIngestionPolicy(self, reference, ingestion_script):
ingestion_policy = self.portal.portal_catalog.getResultValue( ingestion_policy = self.portal.portal_catalog.getResultValue(
portal_type = 'Ingestion Policy', portal_type = 'Ingestion Policy',
......
...@@ -46,10 +46,9 @@ ...@@ -46,10 +46,9 @@
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple>
<string>W:125, 4: Unused variable \'ingestion_id\' (unused-variable)</string> <string>W:108, 4: Unused variable \'ingestion_id\' (unused-variable)</string>
<string>W:132, 34: Unused variable \'i\' (unused-variable)</string> <string>W:115, 34: Unused variable \'i\' (unused-variable)</string>
<string>W:132, 76: Unused variable \'j\' (unused-variable)</string> <string>W:115, 76: Unused variable \'j\' (unused-variable)</string>
<string>W: 9, 0: Unused datetime imported from datetime (unused-import)</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -105,11 +104,13 @@ ...@@ -105,11 +104,13 @@
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
<pickle> <pickle>
<tuple> <dictionary>
<none/> <item>
<key> <string>_log</string> </key>
<value>
<list> <list>
<dictionary> <dictionary>
<item> <item>
...@@ -122,7 +123,9 @@ ...@@ -122,7 +123,9 @@
</item> </item>
</dictionary> </dictionary>
</list> </list>
</tuple> </value>
</item>
</dictionary>
</pickle> </pickle>
</record> </record>
</ZopeData> </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