예제 #1
0
def test_invalid_signature_order(orderbook: OrderBook,
                                 invalid_signature_order: Order):
    orderbook.add_exchange(
        DummyExchangeProxy(invalid_signature_order.exchange_address))
    assert not orderbook.validate(invalid_signature_order)
    with pytest.raises(OrderInvalidException):
        orderbook.add_order(invalid_signature_order)
예제 #2
0
def test_valid_order(orderbook: OrderBook, valid_order: Order):
    orderbook.add_exchange(DummyExchangeProxy(valid_order.exchange_address))
    assert orderbook.validate(valid_order)
    orderbook.add_order(valid_order)
예제 #3
0
def test_expired_order(orderbook: OrderBook, expired_order: Order):
    orderbook.add_exchange(DummyExchangeProxy(expired_order.exchange_address))
    assert not orderbook.validate(expired_order)
    with pytest.raises(OrderInvalidException):
        orderbook.add_order(expired_order)
예제 #4
0
def test_invalid_exchange_order(orderbook: OrderBook, valid_order: Order):
    assert not orderbook.validate(valid_order)
    with pytest.raises(OrderInvalidException):
        orderbook.add_order(valid_order)