ENH: Verify params passed to get_datetime

This commit is contained in:
Jean Bredeche
2016-07-21 14:15:42 -04:00
parent 71b2363775
commit 63ef840363
2 changed files with 25 additions and 9 deletions
+17
View File
@@ -319,6 +319,23 @@ def handle_data(context, data):
algo.namespace['assert_equal'] = self.assertEqual
algo.run(self.data_portal)
def test_datetime_bad_params(self):
algo_text = """
from zipline.api import get_datetime
from pytz import timezone
def initialize(context):
pass
def handle_data(context, data):
get_datetime(timezone)
"""
with self.assertRaises(TypeError):
algo = TradingAlgorithm(script=algo_text,
sim_params=self.sim_params,
env=self.env)
algo.run(self.data_portal)
def test_get_environment(self):
expected_env = {
'arena': 'backtest',