Changes test factory to use Event instead of ndict.

As more sources are moving off of ndict,
changing the factory to use Event, so that when testing we are
exercising use of Event.
This commit is contained in:
Eddie Hebert
2013-01-06 17:13:07 -05:00
parent 59dbffb3aa
commit 799a357d98
2 changed files with 5 additions and 2 deletions
+3
View File
@@ -50,5 +50,8 @@ class Event(object):
def __eq__(self, other):
return self.__dict__ == other.__dict__
def __contains__(self, name):
return name in self.__dict__
def __repr__(self):
return "Event({0})".format(self.__dict__)
+2 -2
View File
@@ -30,7 +30,7 @@ from datetime import datetime, timedelta
import zipline.finance.risk as risk
from zipline.utils.date_utils import tuple_to_date
from zipline.utils.protocol_utils import ndict
from zipline.protocol import Event
from zipline.sources import (SpecificEquityTrades,
DataFrameSource,
DataPanelSource)
@@ -144,7 +144,7 @@ def create_trade_history(sid, prices, amounts, interval, trading_calendar,
def create_txn(sid, price, amount, datetime):
txn = ndict({
txn = Event({
'sid': sid,
'amount': amount,
'dt': datetime,