Commit c3fa8672 authored by Kirill Smelkov's avatar Kirill Smelkov

erp5_wendelin/test/test_01_IngestionFromFluentd: Resulting zarray should be 100000 not 99999

Consider this:

    In [1]: l = range(100000)

    In [2]: min(l)
    Out[2]: 0

    In [3]: max(l)
    Out[3]: 99999

    In [4]: len(l)
    Out[4]: 100000

so if we assert that zarray min=0 and max=99999 the length should be max+1
which is 100000.

NOTE the length is not 100001, as one would guess from test number sequence
created at the beginning of the test:

  def chunks(l, n):
    """Yield successive n-sized chunks from l."""
    for i in xrange(0, len(l), n):
      yield l[i:i+n]

  ...

    number_string_list = []
    for my_list in list(chunks(range(0, 100001), 10)):
      number_string_list.append(','.join([str(x) for x in my_list]))
    real_data = '\n'.join(number_string_list)

because processing code "eats" numbers till last \n and for 10001 last \n is located before 100000:

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

I will fix input data generation in the following patch.

/cc @Tyagov
parent bf0adf22
......@@ -150,8 +150,7 @@ class Test(ERP5TypeTestCase):
self.assertNotEqual(None, zarray)
self.assertEqual(99999.0, np.amax(zarray, axis=0))
self.assertEqual(0.0, np.amin(zarray, axis=0))
# failing in array shape, not investigated why
self.assertEqual((99999,), zarray.shape)
self.assertEqual((100000,), zarray.shape)
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