Commit 40acb891 authored by Kirill Smelkov's avatar Kirill Smelkov

erp5_wendelin/test/test_01_IngestionFromFluentd: Make sure we process all numbers in 'real_data'

As explained in previous commit, real_data tail was ending without \n

    99988,99989\n99990,99991,99992,99993,99994,99995,99996,99997,99998,99999\n100000

and because DataStream_copyCSVToDataArray() processes data in full lines only,
the tail was lost.

Fix t by making sure the last line is always terminated properly with \n.

/cc @Tyagov
parent c3fa8672
...@@ -79,6 +79,8 @@ class Test(ERP5TypeTestCase): ...@@ -79,6 +79,8 @@ class Test(ERP5TypeTestCase):
for my_list in list(chunks(range(0, 100001), 10)): for my_list in list(chunks(range(0, 100001), 10)):
number_string_list.append(','.join([str(x) for x in my_list])) number_string_list.append(','.join([str(x) for x in my_list]))
real_data = '\n'.join(number_string_list) real_data = '\n'.join(number_string_list)
# make sure real_data tail is also a full line
real_data += '\n'
# create ingestion policy # create ingestion policy
ingestion_policy = portal.portal_ingestion_policies.newContent( \ ingestion_policy = portal.portal_ingestion_policies.newContent( \
...@@ -148,9 +150,9 @@ class Test(ERP5TypeTestCase): ...@@ -148,9 +150,9 @@ class Test(ERP5TypeTestCase):
# test that extracted array contains same values as input CSV # test that extracted array contains same values as input CSV
self.assertNotEqual(None, zarray) self.assertNotEqual(None, zarray)
self.assertEqual(99999.0, np.amax(zarray, axis=0)) self.assertEqual(100000.0, np.amax(zarray, axis=0))
self.assertEqual(0.0, np.amin(zarray, axis=0)) self.assertEqual(0.0, np.amin(zarray, axis=0))
self.assertEqual((100000,), zarray.shape) self.assertEqual((100001,), zarray.shape)
def test_02_Examples(self): def test_02_Examples(self):
""" """
......
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