From 34647ec6c4e126f7b1445b10bfaceaa8e1fa2bba Mon Sep 17 00:00:00 2001 From: fawce Date: Mon, 8 Dec 2014 16:47:11 -0500 Subject: [PATCH] added tests to confirm the full environment returns as expected. --- tests/test_algorithm.py | 6 +++--- zipline/algorithm.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_algorithm.py b/tests/test_algorithm.py index b1b94edf..b9c874e7 100644 --- a/tests/test_algorithm.py +++ b/tests/test_algorithm.py @@ -503,11 +503,11 @@ class TestAlgoScript(TestCase): algo.run(self.df) def test_api_get_environment(self): - environment = 'zipline' + platform = 'zipline' algo = TradingAlgorithm(script=api_get_environment_algo, - environment=environment) + platform=platform) algo.run(self.df) - self.assertEqual(algo.environment, environment) + self.assertEqual(algo.environment, platform) def test_api_symbol(self): algo = TradingAlgorithm(script=api_symbol_algo) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 4151e047..7050120f 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -148,7 +148,7 @@ class TradingAlgorithm(object): self._recorded_vars = {} self.namespace = kwargs.get('namespace', {}) - self._environment = kwargs.pop('environment', 'zipline') + self._platform = kwargs.pop('platform', 'zipline') self.logger = None @@ -552,7 +552,7 @@ class TradingAlgorithm(object): 'start': self.sim_params.first_open, 'end': self.sim_params.last_close, 'capital_base': self.sim_params.capital_base, - 'platform': self._environment + 'platform': self._platform } if field == '*': return env