Assert conditions like a nerd
parent
d7317c3710
commit
973c068e96
|
@ -122,12 +122,15 @@ def _assert(
|
||||||
|
|
||||||
'''
|
'''
|
||||||
if assert_entries:
|
if assert_entries:
|
||||||
assert last_msg['broker'] == broker
|
for key, val in [
|
||||||
assert last_msg['account'] == account
|
('broker', broker),
|
||||||
assert last_msg['symbol'] == fqsn
|
('account', account),
|
||||||
assert last_msg['size'] == size * executions
|
('symbol', fqsn),
|
||||||
assert last_msg['currency'] == symbol
|
('size', size * executions),
|
||||||
assert last_msg['avg_price'] == table.pps[symbol].ppu
|
('currency', symbol),
|
||||||
|
('avg_price', table.pps[symbol].ppu)
|
||||||
|
]:
|
||||||
|
assert last_msg[key] == val
|
||||||
|
|
||||||
if assert_pps:
|
if assert_pps:
|
||||||
last_ppu = pps[(broker, account)][-1]
|
last_ppu = pps[(broker, account)][-1]
|
||||||
|
|
Loading…
Reference in New Issue