def test_get_levels_general(self): book1 = OrderBook() book1.update_level(2, 4, True) book1.update_level(3, 4, True) book1.update_level(5, 2, False) book1.update_level(3, 1, False) assert book1.get_levels() == (([(3,4)], [(2, 4)]),([(3,1)],[(5, 2)]))
def test_get_levels_general_empty_buy_list(self): book1 = OrderBook() book1.update_level(2, 4, False) book1.update_level(3, 4, False) assert book1.get_levels() == ((), ([(2, 4)],[(3, 4)]))
def test_get_levels_general_empty_sell_list(self): book1 = OrderBook() book1.update_level(2, 4, True) book1.update_level(3, 4, True) assert book1.get_levels() == (([(3, 4)],[(2, 4)]), ())