From 75e60fdc91b7af87781315f01453ff849b86cd1f Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Sat, 29 Dec 2012 18:45:31 -0500 Subject: [PATCH] Fixes number of bars to create covering date range in test. There are only 6 trading days between the open and close specified in test_perf test. Also, removes getting the period_end off of the last trade, since the test can now use the end date specified for the trading environment. --- tests/test_perf_tracking.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/test_perf_tracking.py b/tests/test_perf_tracking.py index 574a254c..76698f28 100644 --- a/tests/test_perf_tracking.py +++ b/tests/test_perf_tracking.py @@ -559,8 +559,8 @@ class TestPerformanceTracker(unittest.TestCase): NumDaysToDelete(start=0, middle=0, end=1)), ("Delete last two days of events", NumDaysToDelete(start=0, middle=0, end=2)), - ("Delete all but one", - NumDaysToDelete(start=2, middle=2, end=2)), + ("Delete all but one event.", + NumDaysToDelete(start=2, middle=1, end=2)), ]) def test_tracker(self, parameter_comment, days_to_delete): """ @@ -587,7 +587,7 @@ class TestPerformanceTracker(unittest.TestCase): day=16, tzinfo=pytz.utc) - trade_count = 7 + trade_count = 6 sid = 133 price = 10.1 price_list = [price] * trade_count @@ -624,10 +624,6 @@ class TestPerformanceTracker(unittest.TestCase): trading_environment, source_id="factory2" ) - - period_start = trade_history[0].dt.replace(hour=0, minute=0, second=0) - period_end = trade_history2[-1].dt - # 'middle' start of 3 depends on number of days == 7 middle = 3 @@ -648,8 +644,6 @@ class TestPerformanceTracker(unittest.TestCase): trade_history.extend(trade_history2) - trading_environment.period_start = period_start - trading_environment.period_end = period_end trading_environment.first_open = \ trading_environment.calculate_first_open() trading_environment.last_close = \