def test_delete_order(): level = Level(price=100.0) orders = [ Order(price=100.0, size=50.0, side=OrderSide.BUY, id="1"), Order(price=100.0, size=50.0, side=OrderSide.BUY, id="2"), ] level.bulk_add(orders=orders) level.delete(order=orders[1]) assert level.volume() == 50.0
def test_zero_volume_level(): level = Level(price=10.0) level.bulk_add(orders=[Order(price=10.0, size=0.0, side=OrderSide.BUY)]) assert level.volume() == 0.0