def test_successful_set_sell_quote(): bid_quote = Quote(MARKET, BID_SIDE, "25.23", 18) ask_quote = Quote(MARKET, ASK_SIDE, "26.20", 233) ask_quote2 = Quote(MARKET, ASK_SIDE, "25.98", 3) tsq = TwoSidedQuote(bid_quote, ask_quote) assert tsq.buy_quote() == bid_quote assert tsq.sell_quote() == ask_quote tsq.set_sell_quote(ask_quote2) assert tsq.buy_quote() == bid_quote assert tsq.sell_quote() == ask_quote2
def test_successful_instantiation_no_cross(): bid_quote = Quote(MARKET, BID_SIDE, "25.23", 18) ask_quote = Quote(MARKET, ASK_SIDE, "26.20", 233) tsq = TwoSidedQuote(bid_quote, ask_quote) assert tsq.buy_quote() == bid_quote assert tsq.sell_quote() == ask_quote TwoSidedQuote(bid_quote, ask_quote, False) TwoSidedQuote(bid_quote, None) TwoSidedQuote(None, ask_quote) TwoSidedQuote(None, None)