Exemplo n.º 1
0
def test_market_creation():
    mrkt = Market(PRODUCT, ENDPOINT, PRICE_FACTORY, min_qty=2, qty_increment=4)
    assert PRODUCT == mrkt.product()
    assert ENDPOINT == mrkt.endpoint()
    assert mrkt.min_price_increment() == mrkt.mpi() == Decimal("0.01")
    assert mrkt.min_qty() == 2
    assert mrkt.qty_increment() == 4
Exemplo n.º 2
0
def test_default_market_creation():
    mrkt = Market(PRODUCT, ENDPOINT, PRICE_FACTORY)
    assert PRODUCT == mrkt.product()
    assert ENDPOINT == mrkt.endpoint()
    assert mrkt.min_price_increment() == mrkt.mpi() == Decimal("0.01")
    assert mrkt.min_qty() == 1
    assert mrkt.qty_increment() == 1
    assert mrkt.max_qty() == sys.maxsize