Corrects wording on event_window test, with regards to empty values.

These tests ensure that there are three, not two, empty values
at the beginning of the transform.

Also, ensures that we are using a window length of 3 on the tests.
So that wordings of errors,etc. match the window length.
This commit is contained in:
Eddie Hebert
2013-01-30 14:00:06 -05:00
parent 5b294faf0c
commit d52a9f3a67
+10 -3
View File
@@ -320,14 +320,21 @@ class TestBatchTransform(TestCase):
algo = BatchTransformAlgorithm()
algo.run(self.source)
wl = algo.window_length
# The following assertion depend on window length of 3
self.assertEqual(wl, 3)
self.assertEqual(algo.history_return_price_class[:wl],
[None] * wl,
"First two iterations should return None")
"First three iterations should return None." + "\n" +
"i.e. no returned values until window is full'" +
"%s" % (algo.history_return_price_class,))
self.assertEqual(algo.history_return_price_decorator[:wl],
[None] * wl,
"First two iterations should return None")
"First three iterations should return None." + "\n" +
"i.e. no returned values until window is full'" +
"%s" % (algo.history_return_price_decorator,))
# After three Nones, the next value should be a data frame
self.assertTrue(isinstance(
algo.history_return_price_class[wl + 1],
algo.history_return_price_class[wl],
pd.DataFrame)
)