ENH: batch_transform now adds arbitrary keys to datapanel.

This commit is contained in:
Thomas Wiecki
2012-12-03 13:41:37 -05:00
committed by Eddie Hebert
parent 803a0cee5c
commit f81addb7df
3 changed files with 48 additions and 7 deletions
+12
View File
@@ -336,6 +336,18 @@ class TestBatchTransform(TestCase):
"Sixth iteration should not be None"
)
# Test whether arbitrary fields can be added to datapanel
field = algo.history_return_arbitrary_fields[-1]
self.assertTrue(
'arbitrary' in field.items,
'datapanel should contain column arbitrary'
)
self.assertTrue(all(
field['arbitrary'].values.flatten() == ['test'] * 8),
'arbitrary dataframe should contain only "test"'
)
# test overloaded class
for test_history in [algo.history_return_price_class,
algo.history_return_price_decorator]: