BUG: support passing an empty list to data methods.

Our type checking code was a bit too aggressive.
This commit is contained in:
Jean Bredeche
2016-04-14 11:11:08 -04:00
parent 25c6d6ea55
commit 63bd7589b7
2 changed files with 22 additions and 5 deletions
+15
View File
@@ -1905,6 +1905,21 @@ def handle_data(context, data):
self.assertEqual(expected, cm.exception.args[0])
def test_empty_asset_list_to_history(self):
algo = TradingAlgorithm(
script=dedent("""
def initialize(context):
pass
def handle_data(context, data):
data.history([], "price", 5, '1d')
"""),
sim_params=self.sim_params,
env=self.env
)
algo.run(self.data_portal)
class TestGetDatetime(TestCase):