def test_add_ask(self): dc = DepthCache('BNB_ETH') ask = [1.0, 2.0] dc.add_ask(ask) assert dc.get_asks() == [ask] assert len(dc.get_bids()) == 0
def test_sorted_asks(self): dc = DepthCache('BNB_ETH') ask = [1.0, 2.0] dc.add_ask(ask) ask2 = [2.0, 3.0] dc.add_ask(ask2) assert dc.get_asks() == [ask, ask2] assert len(dc.get_bids()) == 0
def test_remove_ask(self): dc = DepthCache('BNB_ETH') ask = [1.0, 2.0] dc.add_ask(ask) ask = [1.0, self.clear_price] dc.add_ask(ask) assert len(dc.get_bids()) == 0 assert len(dc.get_asks()) == 0