switched the socket allocator to be a class variable for the test case.

This commit is contained in:
fawce
2012-03-11 20:28:05 -04:00
parent 366405927d
commit 99d51f58f5
2 changed files with 10 additions and 8 deletions
+6 -4
View File
@@ -116,10 +116,12 @@ class OrderDataSource(qmsg.DataSource):
order_dt = None
count = 0
while True:
(rlist, wlist, xlist) = select([self.order_socket],
[],
[self.order_socket],
timeout=self.heartbeat_timeout/1000) #select timeout is in sec
(rlist, wlist, xlist) = select(
[self.order_socket],
[],
[self.order_socket],
timeout=self.heartbeat_timeout/1000
)
#no more orders, should this be an error condition?
if len(rlist) == 0 or len(xlist) > 0:
+4 -4
View File
@@ -30,6 +30,8 @@ class FinanceTestCase(TestCase):
self.treasury_curves
)
self.allocator = AddressAllocator(8)
def test_trade_feed_protocol(self):
@@ -133,8 +135,7 @@ class FinanceTestCase(TestCase):
# --------------
# Allocate sockets for the simulator components
allocator = AddressAllocator(8)
sockets = allocator.lease(8)
sockets = self.allocator.lease(8)
addresses = {
'sync_address' : sockets[0],
@@ -207,8 +208,7 @@ class FinanceTestCase(TestCase):
# --------------
# Allocate sockets for the simulator components
allocator = AddressAllocator(8)
sockets = allocator.lease(8)
sockets = self.allocator.lease(8)
addresses = {
'sync_address' : sockets[0],