mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 14:03:08 +08:00
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:
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user