mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-09 17:29:26 +08:00
switched the socket allocator to be a class variable for the test case.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user